home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / finger / part01 next >
Encoding:
Text File  |  1992-04-04  |  74.4 KB  |  2,612 lines

  1. Newsgroups: comp.sources.unix
  2. From: phil@Shiva.COM (Phil Budne)
  3. Subject: v25i164: finger - Phil's Finger Program, Part01/07
  4. Sender: unix-sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: phil@Shiva.COM (Phil Budne)
  8. Posting-Number: Volume 25, Issue 164
  9. Archive-Name: finger/part01
  10.  
  11. [ This is the last of Volume 25, and the last of the things inherited from
  12.   the previous moderator.  Submissions received since November 1991 will be
  13.   in Volume 26, which I'll open next week.  --vix ]
  14.  
  15. This is a new distribution of "finger" Un*x systems I have written. It
  16. was written in the spirit of ITS and TOPS-20 fingers.
  17.  
  18. Here is some sample output;
  19.  
  20. -User-       --Full name--       -What- Idle TTY -Console Location-
  21. budd     + Philip Budne           finger      p2  buit2:0; Office: MCS 107
  22. bzs     + Barry Shein           csh       5:13 p5  bu-cs (Remote Login)
  23.                    csh       8:30 p8  buit4 (Remote Login)
  24. jdh     S Jason Heirtzler       xemacs 7:45 p0  buit12 (X display 0)
  25. tower     + Leonard H. Tower Jr.       csh       6:59 p4  buit3 (X display 0)
  26.                    xemacs 4:26 p6  buit3 (X display 0)
  27.                    xemacs+5:02 p7  buit3 (X display 0)
  28.  
  29. Finger has run on the following systems (See README for a more
  30. detailed and current list);
  31.  
  32.     VAX    (BSD and Ultrix)
  33.     SunOS    (Sun-2,3,4,386i)
  34.     Encore Multimax (Umax 4.2, Umax V)
  35.     Celerity accel
  36.     IBM RT/PC (ACIS 4.3, AIX 2.1.2)
  37.     Silicon Graphics (MIPS)
  38.     DEC{station,system!} 3100
  39.     Sony News (68020)
  40.     Interactive 386/ix S5R3.2
  41.  
  42. I would like to hear from anyone who ports this to a new architecture.
  43.  
  44.     Phil Budne
  45.     Boston, July 6, 1990
  46.     budd@bu-it.bu.edu
  47.     uunet!bu-it.bu.edu!budd
  48.  
  49. #! /bin/sh
  50. # This is a shell archive.  Remove anything before this line, then unpack
  51. # it by saving it into a file and typing "sh file".  To overwrite existing
  52. # files, type "sh file -c".  You can also feed this as standard input via
  53. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  54. # will see the following message at the end:
  55. #        "End of archive 1 (of 7)."
  56. # Contents:  COMDEFALL COPYRIGHT COUNT Cover DIFFALL Distfile FINDDEFS
  57. #   MODES ORIG README SAMPLE-conf SAMPLE-flags SAMPLE-nttyloc VERSION
  58. #   WISHES cc-M daemon.h defs.awk fingerd.8c getgroup.c global.c
  59. #   hungry hungry/README hungry/hungry.1c hungry/hungry.c
  60. #   hungry/hungry.h hungry/rwho-changes hungry/rwho.1c-changes
  61. #   hungry/rwhod-changes inet_netof.c inet_ntoa.c info.h inquire.c
  62. #   inquire.h kmem.h locname.c make-version myecho.c mywhoami.c
  63. #   output.h person.h pr.h pversion.c remote.h skip.c strings.h
  64. #   symdate.c tsel.h ttylocfile.h upper.c upper.h waitstate.h
  65. # Wrapped by budd@bu-it on Fri Jul  6 13:21:59 1990
  66. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  67. if test -f COMDEFALL -a "${1}" != "-c" ; then 
  68.   echo shar: Will not over-write existing file \"COMDEFALL\"
  69. else
  70. echo shar: Extracting \"COMDEFALL\" \(605 characters\)
  71. sed "s/^X//" >COMDEFALL <<'END_OF_COMDEFALL'
  72. X#!/bin/sh
  73. X# re-comdef files which need it
  74. X# Copyright (C) 1989, 1990  Philip L. Budne
  75. X#
  76. X# This file is part of "Phil's Finger Program".
  77. X#
  78. X# This program is free software; you can redistribute it and/or modify
  79. X# it under the terms of the GNU General Public License as published by
  80. X# the Free Software Foundation; either version 1, or (at your option)
  81. X# any later version.
  82. X#
  83. X
  84. X# $Id: COMDEFALL,v 3.0 90/07/06 13:09:42 budd Rel $
  85. X
  86. Xtmp=/tmp/comdef$$
  87. Xfor f in *.[ch] *.cpp ymakefile; do
  88. X    comdef < $f > $tmp
  89. X    if cmp -s $f $tmp; then
  90. X        echo >/dev/null
  91. X    else
  92. X        echo $f has changed
  93. X        cp $tmp $f
  94. X    fi
  95. Xdone
  96. Xrm -f $tmp
  97. END_OF_COMDEFALL
  98. if test 605 -ne `wc -c <COMDEFALL`; then
  99.     echo shar: \"COMDEFALL\" unpacked with wrong size!
  100. fi
  101. chmod +x COMDEFALL
  102. # end of overwriting check
  103. fi
  104. if test -f COPYRIGHT -a "${1}" != "-c" ; then 
  105.   echo shar: Will not over-write existing file \"COPYRIGHT\"
  106. else
  107. echo shar: Extracting \"COPYRIGHT\" \(421 characters\)
  108. sed "s/^X//" >COPYRIGHT <<'END_OF_COPYRIGHT'
  109. X/*
  110. X * Copyright (C) 1986, 1990  Philip L. Budne
  111. X *
  112. X * This file is part of "Phil's Finger Program".
  113. X *
  114. X * This program is free software; you can redistribute it and/or modify
  115. X * it under the terms of the GNU General Public License as published by
  116. X * the Free Software Foundation; either version 1, or (at your option)
  117. X * any later version.
  118. X */
  119. X
  120. X# define FOO_RCSID "$Id$"
  121. X
  122. X#ifndef lint
  123. Xstatic char *rcsid = "$Id$";
  124. X#endif
  125. END_OF_COPYRIGHT
  126. if test 421 -ne `wc -c <COPYRIGHT`; then
  127.     echo shar: \"COPYRIGHT\" unpacked with wrong size!
  128. fi
  129. # end of overwriting check
  130. fi
  131. if test -f COUNT -a "${1}" != "-c" ; then 
  132.   echo shar: Will not over-write existing file \"COUNT\"
  133. else
  134. echo shar: Extracting \"COUNT\" \(177 characters\)
  135. sed "s/^X//" >COUNT <<'END_OF_COUNT'
  136. Xecho TODO:
  137. Xgrep '^[0-9]' TODO | wc -l
  138. Xecho TODOs in code:
  139. Xgrep TODO *.[ch] | wc -l
  140. X
  141. Xecho WISHES file:
  142. Xgrep '^[0-9]' WISHES | wc -l
  143. Xecho WISHs in code:
  144. Xgrep WISH *.[ch] | wc -l
  145. X
  146. END_OF_COUNT
  147. if test 177 -ne `wc -c <COUNT`; then
  148.     echo shar: \"COUNT\" unpacked with wrong size!
  149. fi
  150. chmod +x COUNT
  151. # end of overwriting check
  152. fi
  153. if test -f Cover -a "${1}" != "-c" ; then 
  154.   echo shar: Will not over-write existing file \"Cover\"
  155. else
  156. echo shar: Extracting \"Cover\" \(1253 characters\)
  157. sed "s/^X//" >Cover <<'END_OF_Cover'
  158. XThis is a new distribution of "finger" Un*x systems I have written. It
  159. Xwas written in the spirit of ITS and TOPS-20 fingers.
  160. X
  161. XHere is some sample output;
  162. X
  163. X-User-       --Full name--       -What- Idle TTY -Console Location-
  164. Xbudd     + Philip Budne           finger      p2  buit2:0; Office: MCS 107
  165. Xbzs     + Barry Shein           csh       5:13 p5  bu-cs (Remote Login)
  166. X                   csh       8:30 p8  buit4 (Remote Login)
  167. Xjdh     S Jason Heirtzler       xemacs 7:45 p0  buit12 (X display 0)
  168. Xtower     + Leonard H. Tower Jr.       csh       6:59 p4  buit3 (X display 0)
  169. X                   xemacs 4:26 p6  buit3 (X display 0)
  170. X                   xemacs+5:02 p7  buit3 (X display 0)
  171. X
  172. XFinger has run on the following systems (See README for a more
  173. Xdetailed and current list);
  174. X
  175. X    VAX    (BSD and Ultrix)
  176. X    SunOS    (Sun-2,3,4,386i)
  177. X    Encore Multimax (Umax 4.2, Umax V)
  178. X    Celerity accel
  179. X    IBM RT/PC (ACIS 4.3, AIX 2.1.2)
  180. X    Silicon Graphics (MIPS)
  181. X    DEC{station,system!} 3100
  182. X    Sony News (68020)
  183. X    Interactive 386/ix S5R3.2
  184. X
  185. XWhere to get it;
  186. X    anonymous ftp from BU.EDU, directory "users/budd/finger"
  187. X    in tar, compressed tar, and shar files.
  188. X
  189. X    I will soon be submitting it to a Usenet sources group.
  190. X
  191. XI would like to hear from anyone who ports this to a new architecture.
  192. X
  193. X    Phil Budne
  194. X    Boston, July 6, 1990
  195. X    budd@bu-it.bu.edu
  196. X    uunet!bu-it.bu.edu!budd
  197. END_OF_Cover
  198. if test 1253 -ne `wc -c <Cover`; then
  199.     echo shar: \"Cover\" unpacked with wrong size!
  200. fi
  201. # end of overwriting check
  202. fi
  203. if test -f DIFFALL -a "${1}" != "-c" ; then 
  204.   echo shar: Will not over-write existing file \"DIFFALL\"
  205. else
  206. echo shar: Extracting \"DIFFALL\" \(515 characters\)
  207. sed "s/^X//" >DIFFALL <<'END_OF_DIFFALL'
  208. X#!/bin/sh
  209. X# diff any files with emacs backup files
  210. X# Copyright (C) 1989, 1990  Philip L. Budne
  211. X#
  212. X# This file is part of "Phil's Finger Program".
  213. X#
  214. X# This program is free software; you can redistribute it and/or modify
  215. X# it under the terms of the GNU General Public License as published by
  216. X# the Free Software Foundation; either version 1, or (at your option)
  217. X# any later version.
  218. X#
  219. X
  220. X# $Id: DIFFALL,v 3.0 90/07/06 13:09:43 budd Rel $
  221. X
  222. Xfor x in *.orig; do
  223. X    y=`basename $x .orig`
  224. X    echo $y
  225. X    diff -c $x $y >$y.diff
  226. Xdone
  227. END_OF_DIFFALL
  228. if test 515 -ne `wc -c <DIFFALL`; then
  229.     echo shar: \"DIFFALL\" unpacked with wrong size!
  230. fi
  231. chmod +x DIFFALL
  232. # end of overwriting check
  233. fi
  234. if test -f Distfile -a "${1}" != "-c" ; then 
  235.   echo shar: Will not over-write existing file \"Distfile\"
  236. else
  237. echo shar: Extracting \"Distfile\" \(381 characters\)
  238. sed "s/^X//" >Distfile <<'END_OF_Distfile'
  239. X# $Id: Distfile,v 3.0 90/07/06 13:09:45 budd Rel $
  240. X
  241. XFILES = (
  242. X    *.[ch] Makefile Distfile ymakefile *.1 *.5 *.8c Install.cpp
  243. X    *.m4 autoconfig TODO WISHES MODES SAMPLE-local-flags Cover
  244. X    README make-version
  245. X    )
  246. X
  247. XEX = ( args.h local.h version.c symdate.h )
  248. X
  249. XHOSTS = ( bucsf bucsb dolphin bu-pub bu-it schlitz grizzly buchmf )
  250. X
  251. X${FILES} -> ${HOSTS}
  252. X    install src/finger ;
  253. X    except ${EX} ;
  254. END_OF_Distfile
  255. if test 381 -ne `wc -c <Distfile`; then
  256.     echo shar: \"Distfile\" unpacked with wrong size!
  257. fi
  258. # end of overwriting check
  259. fi
  260. if test -f FINDDEFS -a "${1}" != "-c" ; then 
  261.   echo shar: Will not over-write existing file \"FINDDEFS\"
  262. else
  263. echo shar: Extracting \"FINDDEFS\" \(145 characters\)
  264. sed "s/^X//" >FINDDEFS <<'END_OF_FINDDEFS'
  265. Xegrep '^#' *.[ch] ymakefile Install.cpp > defs
  266. Xecho ==
  267. Xawk -f defs.awk defs | sort | uniq
  268. Xecho ==
  269. Xgrep ' if ' defs
  270. Xecho ==
  271. Xgrep ' defined ' defs
  272. END_OF_FINDDEFS
  273. if test 145 -ne `wc -c <FINDDEFS`; then
  274.     echo shar: \"FINDDEFS\" unpacked with wrong size!
  275. fi
  276. # end of overwriting check
  277. fi
  278. if test -f MODES -a "${1}" != "-c" ; then 
  279.   echo shar: Will not over-write existing file \"MODES\"
  280. else
  281. echo shar: Extracting \"MODES\" \(58 characters\)
  282. sed "s/^X//" >MODES <<'END_OF_MODES'
  283. X
  284. X/*
  285. X * Local variables:
  286. X * comment-column: 40
  287. X * End:
  288. X */
  289. END_OF_MODES
  290. if test 58 -ne `wc -c <MODES`; then
  291.     echo shar: \"MODES\" unpacked with wrong size!
  292. fi
  293. # end of overwriting check
  294. fi
  295. if test -f ORIG -a "${1}" != "-c" ; then 
  296.   echo shar: Will not over-write existing file \"ORIG\"
  297. else
  298. echo shar: Extracting \"ORIG\" \(158 characters\)
  299. sed "s/^X//" >ORIG <<'END_OF_ORIG'
  300. X#!/bin/sh
  301. X# $Id: ORIG,v 3.0 90/07/06 13:10:15 budd Rel $
  302. Xif [ -f $1.orig ]; then
  303. X    echo $1.orig exists 1>&2
  304. X    exit 1
  305. Xfi
  306. Xmv $1 $1.orig
  307. Xcp $1.orig $1
  308. Xchmod +w $1
  309. END_OF_ORIG
  310. if test 158 -ne `wc -c <ORIG`; then
  311.     echo shar: \"ORIG\" unpacked with wrong size!
  312. fi
  313. chmod +x ORIG
  314. # end of overwriting check
  315. fi
  316. if test -f README -a "${1}" != "-c" ; then 
  317.   echo shar: Will not over-write existing file \"README\"
  318. else
  319. echo shar: Extracting \"README\" \(10524 characters\)
  320. sed "s/^X//" >README <<'END_OF_README'
  321. XCopyright (C) 1988, 1990  Philip L. Budne
  322. X
  323. XThis file is part of "Phil's Finger Program".
  324. X
  325. XThis program is free software; you can redistribute it and/or modify
  326. Xit under the terms of the GNU General Public License as published by
  327. Xthe Free Software Foundation; either version 1, or (at your option)
  328. Xany later version.
  329. X
  330. XThis program is distributed in the hope that it will be useful,
  331. Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
  332. XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  333. XGNU General Public License for more details.
  334. X
  335. XYou should have received a copy of the GNU General Public License
  336. Xalong with this program; if not, write to the Free Software
  337. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  338. X
  339. X================================================================
  340. X
  341. XThis program is my shaggy dog story, it grew in the telling (it has
  342. Xuncovered more than one bug in gcc over the years). I started by
  343. Xwanting a free source finger which sorted output by username.  It was
  344. Xmy first major undertaking on Unix (before I knew about qsort(3)), and
  345. Xin the words of Bruce Leverett in "Register Allocation in Optimizing
  346. XCompilers";
  347. X
  348. X    But in our enthusiasm, we could not resist a radical overhaul
  349. X    of the system, in which all of its major weaknesses have been
  350. X    exposed, analyzed, and replaced with new weaknesses.
  351. X
  352. X================================================================
  353. X$Id: README,v 3.0 90/07/06 13:10:17 budd Rel $
  354. X================================================================
  355. XThis program has run under;
  356. X
  357. X    VAX
  358. X        BSD    4.2    (11/730,750,780)        LONG AGO
  359. X        BSD    4.3    (11/750)            2(335) 6/22/89
  360. X        Ultrix    3.0    (VS-II/GPX)            2(337) 7/89
  361. X        Ultrix    3.1    (6410)                2(341) 2/17/90
  362. X
  363. X    Sun-2
  364. X        3.2        (2/120)                2(332) 6/15/89
  365. X
  366. X    Sun-3
  367. X        3.4        (3/50,60,160,180,280)        2(341) 7/13/89
  368. X        3.5        (3/50,180)            2(341) 7/14/89
  369. X        4.0.1        (3/60)                2(367) 6/26/90
  370. X        4.0.3        (3/50,60,80,160,180,280)    2(336) 6/26/89
  371. X
  372. X    Sun-4
  373. X        3.2        (4/280)                2(336) 6/25/89
  374. X        4.0.3        (4/60,110,280)            2(367) 6/20/90
  375. X        4.1         (4/65)                2(367) 6/26/90
  376. X
  377. X    Sun 386i
  378. X        4.0.1, 4.0.3                    2(355) 5/8/90
  379. X
  380. X    Encore Multimax Umax 4.[23]
  381. X        3.1        XPC (ns32532)            2(367) 6/25/90
  382. X        3.1        APC (ns32332)            2(332) 6/15/89
  383. X        3.1        DPC (ns32032)            2(304) 7/21/88
  384. X
  385. X        4.0        APC (ns32332)            2(367) 6/20/90
  386. X
  387. X    Encore Multimax Umax V S5R3.1
  388. X        2.2h        APC (ns32332)            2(367) 6/25/90
  389. X
  390. X    Celerity accel
  391. X        3.4.87        C1260D,C1200            2(363) 5/18/90
  392. X
  393. X    IBM ROMP
  394. X        AIX 2.1.2    RT-125                2(367) 6/25/90
  395. X        ACIS/AOS 4.3 (pcc or hc 1.4)
  396. X                ATR-6152, RT-125,130        2(336) 6/25/89
  397. X
  398. X    Silicon Graphics (sgi)
  399. X        3.1F        4D/IP5 (MIPS R2000)        2(336) 6/26/89
  400. X        3.2.1        4D/IP6 (MIPS R2000A)        2(355) 4/25/90
  401. X        3.2.1        4D/IP7 (MIPS R3000)        2(364) 5/23/90
  402. X
  403. X    DECstation-3100 Ultrix 3.1                2(355) 4/25/90
  404. X
  405. X    Sony NEWS-OS 3.2 News-841 (68020)            2(346) 1/4/90
  406. X
  407. X    Interactive 386/ix S5R3.2                2(350) 1/12/90
  408. X
  409. X    Sequent DYNIX (ucb universe)
  410. X        3.0.17.10.2    S3 (i386)            2(362) 5/17/90
  411. X
  412. X    IBM RIOS
  413. X        AIX 3.1 9013S1    RS/6000 mod 320            2(365) 6/4/90
  414. X
  415. XPorts to new architectures will almost certainly have to modify
  416. Xustruct.[ch], readpr.c and perhaps read_vmunix.c and getcommand.c
  417. X
  418. XIf you port to any new machines or operating systems, please send the
  419. Xdiffs to me (see the ORIG and DIFFALL scripts).
  420. X
  421. XDefines of interest (put in local-flags);
  422. X
  423. XALWAYS_PRINT_HEADER    If defined print header line even if only one user
  424. XARCHITECTURE        String used by fingerd to formulate default banner
  425. X            defaulted by architecture if not set
  426. XAUTONLIST        If defined check to see that running kernel
  427. X            matches saved-nlist file
  428. XBIG_CONSOLE        String to tag on display of virtual console
  429. X            (def: "[console]")
  430. XBUFIO            If non-zero read kmem etc with stdio (total lose)
  431. XC_COMPILER        Optional name of C compiler to use (ymakefile)
  432. XC_FLAGS            Optional flags to pass to C compuler (ymakefile)
  433. XDEBUG            If defined turns on debugging.  Usually used per-module
  434. XDEBUGSW            If defined "-deb" option prints useful information
  435. XDEFAULT_DAEMON        Ttyloc string to display if no daemon & on PTY
  436. X            (Default: "Virtual Terminal")
  437. XDEFCYCLE        Default integer cycle time (in seconds) for
  438. X            ttyrandom/ttycycle and ttyloc timeouts (def: 120sec)
  439. XDEFSHELL        String containing default shell name (Def: "/bin/csh")
  440. XDEFWIDTH        Default integer terminal with if cannot get
  441. X            from termcap
  442. XDONT_TAB_PLAN        If defined, do not tab in plan by one tab stop
  443. XDONT_SAY_HACKING    Don't use the "H" word in whois displays
  444. XDONT_SAY_TRYING        Suppress Trying ... messages for remote finger
  445. XDONT_USE_TTYENT_TYPE_AS_SHORT
  446. X            If defined do NOT use 4.3 style /etc/ttys ttytype
  447. X            as "short" location
  448. XEMPTY_CMD        String to print if no command found (default "??")
  449. XFINGER0            Argv[0] passed by fingerd to finger  (def "finger")
  450. XFINGERPATHS        Optional list of strings containing local paths for
  451. X            fingerd to use to try to invoke finger
  452. XGETPWNAM_SLOW        If defined avoid repeated use of getpwnam()
  453. XGRP_HEADER        Character to use as header for group column in display
  454. XHIDDEN_PROGRAMS        Optional list of names (strings) of programs that you
  455. X            might not want to have displayed (ie; "gamescontrol")
  456. XINCLUDE_PATH        Any -I commands needed for compilation.
  457. X            (ie; if you need to get a special netdb.h for resolver)
  458. XINETD            If defined compile finderd for launch by inetd
  459. XINIT_PID        Integer pid of "init" process (parent of all) (def: 1)
  460. XINQUIRE            If defined, use an inquire database (see NINQUIRE)
  461. XIPPORT_FINGER        TCP port to use if services lookup failes (def: 79)
  462. XJUST_ADDR_GIVEN        If defined do just address specified by finger @number
  463. XKERNEL_FILE        String name of booted kernel (def: "/vmunix")
  464. XKMEM_GROUP        4.3 group with read access to /dev/kmem... (Install.cpp)
  465. XLIB_RESOLVE        Path (or -lname) for resolver library, if desired.
  466. XLLPATH            Path for BSD lastlog file (def: "/usr/adm/lastlog")
  467. X            needs to be replaced by something PER NFS clusterer.
  468. XLMASK            If defined (per architecture) mask for start addr
  469. X            to get kernel load address.
  470. XLOADADDR        If defined (per architecture) used as kernel load
  471. X            address (overrides LMASK)
  472. XLOCAL_DAEMONS        Optional local daemons which can parent "logins"
  473. X            (see daemons.c)
  474. XLOCFILE            Name of old style ttyloc file (def: "/etc/ttyloc")
  475. XMINCYCLE        Minimum integer cycle time in seconds for ttycycle...
  476. X            (Default: 60sec)
  477. XMONNAME            Filename to get fingerd banner from (def: "/etc/monnam")
  478. XMUST_HAVE_TTY        If defined Only fetch ustruct for process' with
  479. X            control terminals. finger runs faster but gives less
  480. X            interesting default ttylocs.
  481. XNETBERK            If defined, remotely invoked finger uses -berk option
  482. XNETFOLLOW        If defined, remotely invoked finger uses -follow option
  483. XNETLOC            If defined, check for BU local U/B network location
  484. XNEVER_SAME        If defined, never suppress uname and pname in displays.
  485. XNINQUIRE        If defined (with INQUIRE) use "new inquire" system.
  486. X            (To be released at a future date)
  487. XNINQUIRE_MATCH        Perform person lookups my matching against
  488. X            whole personal name. Does not work due to commas.
  489. X            Default is to use lastname hash table.
  490. XNLIST_MODE        Integer file mode for saved-nlist file creation
  491. XNLOCFILE        Name of new style ttyloc file (def: "/etc/nttyloc")
  492. XNO_X_WINDOWS        If defined suppress special processing for HOST:DISPLAY
  493. XNOLOGIN            Name of no logins file (def: "/etc/nologin")
  494. XNON_HARDWIRE_TYPES    Optional list of TERM types to treat as non-hardwired
  495. X            in ttyask
  496. XNOSTRIP            If defined, Install will not strip installed files
  497. XOTTYLOC            If defined check ~/.ttyloc file (depricated)
  498. XPAGER            Pager to use for help output.  (def: "more")
  499. XPICKY            If defined, make sure new /vmunix matches running kernel
  500. XPID_BITS        Default number of bits in a Un*x pid. (def: 15)
  501. XPID_T            Type for a pid. (def: short)
  502. XPREFIXES        Host prefixes to remove if ttyloc set. See SAMPLE*
  503. XPRESERVE_HOST_CASE    If defined do not upcase host names.
  504. XPRJLEN            Max length of string to get from .project file (def: 70)
  505. XPTYPATH            Path for a known pseudo terminal tty (slave end)
  506. X            (def: "/dev/ttyp0")
  507. XRELATION        If defined display INQUIRE relation as well as group
  508. XREL_SUP            If defined, a string of RELATIONS to not display
  509. XSAVED_NLIST        If defined, save namelist to SAVED_NLIST file
  510. XSMALL_CONSOLE        Short string to tag on display of virtual console.
  511. X            (def: "[console]" -- was once "[cons]")
  512. XSUID_OTHER        Char displayed after programs running under alien uid.
  513. XSUID_ROOT        Char displayed after programs running suid root.
  514. XSUPPRESS_WHAT        If defined suppress display of "-What-"
  515. XSYSLOG            If defined fingerd performs syslog()ing
  516. XGETTTYENT        If Defined use getttyent routines to get tty type
  517. XTTYLOC_DIR        String containing directory for ttyloc files
  518. XTTYLOC_MODE        Integer mode for ttyloc file creation
  519. XTTY_GROUP        If defined, assume ttys group write to this group
  520. XTTY_GROUP_NUMBER    If defined, use as fallback if TTY_GROUP lookup fails
  521. XTTY_REQUIRES_IOCTL    If defined #include sys/tty.h before sys/ioctl.h
  522. XUID_NOBODY        Integer uid to run finger under from fingerd (def: -2)
  523. XUNPREFIX_NODOMAIN    If defined, remove PREFIXES from hosts w/o domains.
  524. XUPTIME            Program to invoke from fingerd to give
  525. X            amusing system stats. (def: "/usr/ucb/uptime")
  526. XUPTIME0            Argv[0] to pass UPTIME program
  527. XUSE_ALL_TTYENTS        If defined do not throw out ttys marked as off in 4.3
  528. X            /etc/ttys file when scanning for ttylocs
  529. XUSER_NOBODY        User to run finger from in fingerd to fall under
  530. X            per user process limits.  Helps prevent
  531. X            runaway .forward loops.
  532. XX10_STR            String used to note X10 xterms (def: "X10")
  533. XX11_STR            String used to note X11 xterms (have screen number)
  534. X            (def: "X11")
  535. XX_LOCAL            If defined treat local xterms differently
  536. XBUGS_TO            Mailing address for bug reports. Displayed
  537. X            in help output. (def: "bug-finger@bu-it.bu.edu")
  538. X
  539. XThe following files contain stuff that will vary from site to site:
  540. X
  541. Xlocname.h
  542. X    At BU-CS we run ttyloc suid daemon and have /usr/spool/ttyloc
  543. X    owned by daemon, with all files created with mode 644.
  544. X
  545. X    You might want to put the files in /tmp, and have the files be
  546. X    world read/write.
  547. X
  548. Xfingerd:
  549. X    Define INETD if you have an inet daemon, and add the correct
  550. X    line to /etc/servers.
  551. X
  552. X    finger should be installed as /usr/bin/finger (not in /usr/ucb).
  553. X
  554. Xtty locations:
  555. X    see the nttyloc.5 man page. An alternative is:
  556. X    Create the file /etc/ttyloc with pairs of tty names
  557. X    (as they appear in /dev) and text.  # starts a comment line.
  558. X    ie;
  559. X
  560. X    # this is a sample old format ttyloc file (/etc/ttyloc)
  561. X    console    Console LA120
  562. X    tty00    VADIC 3451
  563. X    tty01    Joe's office
  564. X
  565. Xnames.c
  566. X    comes with SAVNLIST set true.  Will try and write the file
  567. X    /etc/finger-saved-nlist.  Finger should be gived setgrp
  568. X    to this file's group (ie; daemon)
  569. X
  570. X================================================================
  571. X
  572. XTo add a switch see;
  573. X    switch.h
  574. X    switch.c
  575. X    flags.h
  576. END_OF_README
  577. if test 10524 -ne `wc -c <README`; then
  578.     echo shar: \"README\" unpacked with wrong size!
  579. fi
  580. # end of overwriting check
  581. fi
  582. if test -f SAMPLE-conf -a "${1}" != "-c" ; then 
  583.   echo shar: Will not over-write existing file \"SAMPLE-conf\"
  584. else
  585. echo shar: Extracting \"SAMPLE-conf\" \(401 characters\)
  586. sed "s/^X//" >SAMPLE-conf <<'END_OF_SAMPLE-conf'
  587. X! $Id: finger.conf,v 1.1 90/04/30 20:29:34 budd Exp Locker: budd $
  588. X%accounts
  589. Xstaff    +    Staff Wizards
  590. Xnseg    N    Networking Systems
  591. Xdsg    D    Distributed Systems
  592. Xcsg    C    Central Systems
  593. Xitother    I    Information Technology
  594. Xusrsrv    U    User Disservices
  595. Xguest    G    Guest
  596. X%phones
  597. Xx3-####
  598. Xx#-####
  599. X(617) ###-####
  600. X(###) ###-####
  601. X%buildings
  602. XM    MCS
  603. XA    MCS
  604. XC    CS
  605. XE    ERB
  606. X%routes
  607. X.DECNET    @BUENGA
  608. X%prefixes
  609. XBUIT
  610. XBU-
  611. XBU
  612. X%hidden
  613. Xgamescontrol
  614. END_OF_SAMPLE-conf
  615. if test 401 -ne `wc -c <SAMPLE-conf`; then
  616.     echo shar: \"SAMPLE-conf\" unpacked with wrong size!
  617. fi
  618. # end of overwriting check
  619. fi
  620. if test -f SAMPLE-flags -a "${1}" != "-c" ; then 
  621.   echo shar: Will not over-write existing file \"SAMPLE-flags\"
  622. else
  623. echo shar: Extracting \"SAMPLE-flags\" \(50 characters\)
  624. sed "s/^X//" >SAMPLE-flags <<'END_OF_SAMPLE-flags'
  625. X/* local-flags for bu-it */
  626. X/*
  627. X# define INQUIRE
  628. X*/
  629. END_OF_SAMPLE-flags
  630. echo shar: Missing newline added to \"SAMPLE-flags\"
  631. if test 50 -ne `wc -c <SAMPLE-flags`; then
  632.     echo shar: \"SAMPLE-flags\" unpacked with wrong size!
  633. fi
  634. # end of overwriting check
  635. fi
  636. if test -f SAMPLE-nttyloc -a "${1}" != "-c" ; then 
  637.   echo shar: Will not over-write existing file \"SAMPLE-nttyloc\"
  638. else
  639. echo shar: Extracting \"SAMPLE-nttyloc\" \(746 characters\)
  640. sed "s/^X//" >SAMPLE-nttyloc <<'END_OF_SAMPLE-nttyloc'
  641. X# /etc/nttyloc file for buita
  642. Xttyloc    console    CTY    "Console DECwriter"
  643. Xrandom    ttya    ???    "AUX A -- usually the console"
  644. Xrandom    ttyb    ???    "AUX B -- not in use"
  645. Xdialup    tty00    ""    "Campus Terminal Network"
  646. Xdialup    tty01    ""    "Campus Terminal Network"
  647. Xdialup    tty02    ""    "Campus Terminal Network"
  648. Xdialup    tty03    ""    "Campus Terminal Network"
  649. Xdialup    tty04    ""    "Campus Terminal Network"
  650. Xdialup    tty05    ""    "Campus Terminal Network"
  651. Xdialup    tty06    ""    "Campus Terminal Network"
  652. Xdialup    tty07    ""    "Campus Terminal Network"
  653. Xdialup    tty08    ax2400c    "ax2400c"
  654. Xdialup    tty09    ax2400c    "ax2400c"
  655. Xrandom    tty0a    ??    "not in use"
  656. Xrandom    tty0b    ??    "not in use"
  657. Xttyloc    tty0c    t800    "IT t800"
  658. Xhardwi    tty0d    print    "IT printer corral"
  659. Xttyloc    tty0e    ps800    "IT ps800"
  660. Xhardwi    tty0f    SID    "IT front office SID"
  661. END_OF_SAMPLE-nttyloc
  662. if test 746 -ne `wc -c <SAMPLE-nttyloc`; then
  663.     echo shar: \"SAMPLE-nttyloc\" unpacked with wrong size!
  664. fi
  665. # end of overwriting check
  666. fi
  667. if test -f VERSION -a "${1}" != "-c" ; then 
  668.   echo shar: Will not over-write existing file \"VERSION\"
  669. else
  670. echo shar: Extracting \"VERSION\" \(68 characters\)
  671. sed "s/^X//" >VERSION <<'END_OF_VERSION'
  672. Xversion 3(400) packed Fri Jul  6 13:21:55 EDT 1990 by budd on bu-it
  673. END_OF_VERSION
  674. if test 68 -ne `wc -c <VERSION`; then
  675.     echo shar: \"VERSION\" unpacked with wrong size!
  676. fi
  677. # end of overwriting check
  678. fi
  679. if test -f WISHES -a "${1}" != "-c" ; then 
  680.   echo shar: Will not over-write existing file \"WISHES\"
  681. else
  682. echo shar: Extracting \"WISHES\" \(588 characters\)
  683. sed "s/^X//" >WISHES <<'END_OF_WISHES'
  684. XAlso grep for WISH in source files;
  685. X
  686. X2/3.    TOPS-10 and/or TOPS-20 SYSTAT format output
  687. X
  688. X19.    pipe output to more?
  689. X
  690. X20.    read .mailrc for aliases (ie; f @mymailiasforfred)
  691. X
  692. X26.    penalize input from pipe (socket)?
  693. X    hard -- have to read file table
  694. X
  695. X30.    notify user when being fingered from afar?
  696. X
  697. X31.    do follow via .rhosts (len) (/rhost-follow ?)
  698. X
  699. X32.    allow finger <systemwidemailalias>
  700. X    use sendmailbox
  701. X
  702. X33.    Do faces (c.f. GNU finger)
  703. X
  704. X# prevent count from getting theese!!
  705. Xdate        here    WISHes in code        Total
  706. X#6/9/88        4    2             6
  707. X#7/5        7    8            15
  708. X#6/15/89     5    10            15
  709. X#6/28        7    9            16
  710. X#7/6/90        8    9            17
  711. END_OF_WISHES
  712. if test 588 -ne `wc -c <WISHES`; then
  713.     echo shar: \"WISHES\" unpacked with wrong size!
  714. fi
  715. # end of overwriting check
  716. fi
  717. if test -f cc-M -a "${1}" != "-c" ; then 
  718.   echo shar: Will not over-write existing file \"cc-M\"
  719. else
  720. echo shar: Extracting \"cc-M\" \(696 characters\)
  721. sed "s/^X//" >cc-M <<'END_OF_cc-M'
  722. X#! /bin/sh
  723. X# cc-M - replacement for cc -M
  724. X# $Id: cc-M,v 3.0 90/07/06 13:10:23 budd Rel $
  725. X
  726. Xflags=
  727. Xfor file in $*
  728. Xdo
  729. X    case $file in
  730. X    -D*|-U*|-I*)
  731. X        flags="$flags $file"
  732. X        ;;
  733. X    -*)
  734. X        ;;
  735. X    *)
  736. X        echo "# # $file"
  737. X# on some systems (AIX/RT) system defines are done by cc passing -D flags!!
  738. X#        /lib/cpp $flags < $file | grep '^# 1 "[^"]'
  739. X        cc -E $flags $file | grep '^# 1 "[^"]'
  740. X        
  741. X        ;;
  742. X    esac
  743. Xdone | awk '
  744. X/# # /    {
  745. X        file = $3
  746. X        lf = length(file)
  747. X        ext = substr(file,lf,1)
  748. X        if (ext == "c" || ext == "y" || ext == "l")
  749. X            left = substr(file,1,lf-1) "o"
  750. X        else
  751. X            left = file
  752. X        print left ": " file
  753. X        next
  754. X     }
  755. X/^# 1 /  {    print left ":\t" substr($3,2,length($3) - 2) }
  756. END_OF_cc-M
  757. if test 696 -ne `wc -c <cc-M`; then
  758.     echo shar: \"cc-M\" unpacked with wrong size!
  759. fi
  760. chmod +x cc-M
  761. # end of overwriting check
  762. fi
  763. if test -f daemon.h -a "${1}" != "-c" ; then 
  764.   echo shar: Will not over-write existing file \"daemon.h\"
  765. else
  766. echo shar: Extracting \"daemon.h\" \(656 characters\)
  767. sed "s/^X//" >daemon.h <<'END_OF_daemon.h'
  768. X/*
  769. X * daemon.h -- Different things that can parent a shell -- January 1988
  770. X *
  771. X * Copyright (C) 1986, 1990  Philip L. Budne
  772. X *
  773. X * This file is part of "Phil's Finger Program".
  774. X *
  775. X * This program is free software; you can redistribute it and/or modify
  776. X * it under the terms of the GNU General Public License as published by
  777. X * the Free Software Foundation; either version 1, or (at your option)
  778. X * any later version.
  779. X *
  780. X */
  781. X
  782. X# define DAEMON_RCSID "$Id: daemon.h,v 3.0 90/07/06 13:10:31 budd Rel $"
  783. X
  784. X/*
  785. X * see also daemon.c, getcommand.c, luser.h and getttyloc.c
  786. X */
  787. X
  788. Xstruct daemon {
  789. X    char
  790. X    *d_cmd,
  791. X    *d_short,
  792. X    *d_long;
  793. X};
  794. X
  795. Xextern struct daemon daemons[];
  796. END_OF_daemon.h
  797. if test 656 -ne `wc -c <daemon.h`; then
  798.     echo shar: \"daemon.h\" unpacked with wrong size!
  799. fi
  800. # end of overwriting check
  801. fi
  802. if test -f defs.awk -a "${1}" != "-c" ; then 
  803.   echo shar: Will not over-write existing file \"defs.awk\"
  804. else
  805. echo shar: Extracting \"defs.awk\" \(170 characters\)
  806. sed "s/^X//" >defs.awk <<'END_OF_defs.awk'
  807. X/#ifdef/            { print $2 }
  808. X/#ifndef/            { print $2 }
  809. X/#define/            { print $2 }
  810. X
  811. X/#[     ][     ]*ifdef/    { print $3 }
  812. X/#[     ][     ]*ifndef/    { print $3 }
  813. X/#[     ][     ]*define/    { print $3 }
  814. END_OF_defs.awk
  815. if test 170 -ne `wc -c <defs.awk`; then
  816.     echo shar: \"defs.awk\" unpacked with wrong size!
  817. fi
  818. # end of overwriting check
  819. fi
  820. if test -f fingerd.8c -a "${1}" != "-c" ; then 
  821.   echo shar: Will not over-write existing file \"fingerd.8c\"
  822. else
  823. echo shar: Extracting \"fingerd.8c\" \(1654 characters\)
  824. sed "s/^X//" >fingerd.8c <<'END_OF_fingerd.8c'
  825. X.\" -*-nroff-*-
  826. X.\" $Id: fingerd.8c,v 3.0 90/07/06 13:10:42 budd Rel $
  827. X.\" Copyright (c) 1987, 1990  Philip L. Budne
  828. X.TH FINGERD 8C "14 June 1988"
  829. X.UC 4
  830. X.SH NAME
  831. Xfingerd \- remote finger server
  832. X.SH SYNOPSIS
  833. X.B /etc/fingerd
  834. X[
  835. X.B -d
  836. X]
  837. X.SH DESCRIPTION
  838. X.I Fingerd
  839. Xis the server for RFC742 style remote
  840. X.IR finger (1)
  841. Xrequests.  If compiled with the SYSLOG option,
  842. X.I fingerd
  843. Xlogs the host for each incomming request.
  844. X
  845. XOn systems without an
  846. X.IR inetd (8) 
  847. X.I fingerd
  848. Xwill for a child which dissowns itself, and exit.  If the
  849. X.B -d
  850. Xoption is given, fingerd will not fork or disown.
  851. XThe child listens for incomming connections for the finger/tcp service.
  852. XIt will then fork a child to handle the connection and continue listening.
  853. X
  854. XThe first thing the child does is print a herald which consists of
  855. Xthe system name, and a line of text from the file
  856. X.I /etc/monnam
  857. X(ie; the twenex PS:<SYSTEM>MONNAM.TXT file).  If
  858. X.I monnam
  859. Xdoes not exist a default message regarding the machine architecture and
  860. Xoperating system will be printed.
  861. X
  862. X.I Fingerd
  863. Xthen forks
  864. X.I /usr/ucb/uptime
  865. Xto print the time, uptime, number of users and load averages.
  866. X
  867. XA single line is then read from the socket, parsed and passed
  868. Xto
  869. X.I finger
  870. Xas an argv. Elements in the command line are delmited by space, tab,
  871. Xcomma, newline, and return.
  872. X
  873. X.SH FILES
  874. X.ta 2i
  875. X.nf
  876. X/etc/monnam    banner printed by fingerd
  877. X/usr/ucb/uptime    used to display user count and load averages
  878. X/usr/bin/finger    path for finger program to run
  879. X/etc/nologin    printed if it exists
  880. X.fi
  881. X.ta
  882. X.SH "SEE ALSO"
  883. Xfinger(1)
  884. X.SH AUTHORS
  885. XPhilip L. Budne and Barry Z. Shein, Boston University
  886. X.SH BUGS
  887. XPerhaps print /etc/motd if no logins allowed?
  888. END_OF_fingerd.8c
  889. if test 1654 -ne `wc -c <fingerd.8c`; then
  890.     echo shar: \"fingerd.8c\" unpacked with wrong size!
  891. fi
  892. # end of overwriting check
  893. fi
  894. if test -f getgroup.c -a "${1}" != "-c" ; then 
  895.   echo shar: Will not over-write existing file \"getgroup.c\"
  896. else
  897. echo shar: Extracting \"getgroup.c\" \(1263 characters\)
  898. sed "s/^X//" >getgroup.c <<'END_OF_getgroup.c'
  899. X/*
  900. X * getgroup.c -- report file group ID for autoconfig
  901. X *
  902. X * Copyright (C) 1988, 1990  Philip L. Budne
  903. X *
  904. X * This file is part of "Phil's Finger Program".
  905. X *
  906. X * This program is free software; you can redistribute it and/or modify
  907. X * it under the terms of the GNU General Public License as published by
  908. X * the Free Software Foundation; either version 1, or (at your option)
  909. X * any later version.
  910. X *
  911. X */
  912. X
  913. X# ifndef lint
  914. Xstatic char *rcsid = "$Id: getgroup.c,v 3.0 90/07/06 13:10:49 budd Rel $";
  915. Xstatic char Copyright[] = "Copyright (C) 1986, 1990  Philip L. Budne";
  916. X# endif /* lint not defined */
  917. X
  918. X# include <sys/types.h>
  919. X# include <sys/stat.h>
  920. X# include <stdio.h>
  921. X# include <grp.h>
  922. X/* cannot use finger.h -- run from autoconfig */
  923. X
  924. Xextern struct group *getgrgid();    /* USG grp.h loses */
  925. X
  926. Xint
  927. Xmain( c, v )
  928. X    int c;
  929. X    char **v;
  930. X{
  931. X    struct stat st;
  932. X    struct group *gr;
  933. X
  934. X    if( c < 1 ) {
  935. X    fprintf( stderr, "Usage %s file\n", v[0] );
  936. X    exit( 1 );
  937. X    }
  938. X    c--;
  939. X    v++;
  940. X    while( c > 0 ) {
  941. X    if( stat( v[0], &st ) < 0 )
  942. X        perror( v[0] );
  943. X    else if( (gr = getgrgid( st.st_gid )) != NULL )
  944. X        printf("%s %d %s\n", v[0], st.st_gid, gr->gr_name );
  945. X    else
  946. X        printf("%s %d\n", v[0], st.st_gid );
  947. X    c--;
  948. X    v++;
  949. X    }
  950. X    return( 0 );            /* be ANSI */
  951. X} /* main */
  952. END_OF_getgroup.c
  953. if test 1263 -ne `wc -c <getgroup.c`; then
  954.     echo shar: \"getgroup.c\" unpacked with wrong size!
  955. fi
  956. # end of overwriting check
  957. fi
  958. if test -f global.c -a "${1}" != "-c" ; then 
  959.   echo shar: Will not over-write existing file \"global.c\"
  960. else
  961. echo shar: Extracting \"global.c\" \(599 characters\)
  962. sed "s/^X//" >global.c <<'END_OF_global.c'
  963. X/*
  964. X * global.c -- holds global symbols
  965. X *
  966. X * Copyright (C) 1986, 1990  Philip L. Budne
  967. X *
  968. X * This file is part of "Phil's Finger Program".
  969. X *
  970. X * This program is free software; you can redistribute it and/or modify
  971. X * it under the terms of the GNU General Public License as published by
  972. X * the Free Software Foundation; either version 1, or (at your option)
  973. X * any later version.
  974. X *
  975. X */
  976. X
  977. X# ifndef lint
  978. Xstatic char *rcsid = "$Id: global.c,v 3.0 90/07/06 13:11:01 budd Rel $";
  979. X# endif /* lint not defined */
  980. X
  981. X# define EXTERN
  982. X# include "args.h"
  983. X
  984. X/*
  985. X * Local variables:
  986. X * comment-column: 40
  987. X * End:
  988. X */
  989. END_OF_global.c
  990. if test 599 -ne `wc -c <global.c`; then
  991.     echo shar: \"global.c\" unpacked with wrong size!
  992. fi
  993. # end of overwriting check
  994. fi
  995. if test ! -d hungry ; then
  996.     echo shar: Creating directory \"hungry\"
  997.     mkdir hungry
  998. fi
  999. if test -f hungry/README -a "${1}" != "-c" ; then 
  1000.   echo shar: Will not over-write existing file \"hungry/README\"
  1001. else
  1002. echo shar: Extracting \"hungry/README\" \(1050 characters\)
  1003. sed "s/^X//" >hungry/README <<'END_OF_hungry/README'
  1004. XScenario:
  1005. X
  1006. XYou are at your terminal and feeling a bit hungry. Perhaps someone
  1007. Xelse is hungry too!  So why eat alone.  Now you can tell the world
  1008. Xabout your needs and set you "hunger bit".
  1009. X
  1010. XInstructions:
  1011. X
  1012. XTo tell the world incant "hungry y", to stop type "hungry n", to
  1013. Xwaffle (twiddle) type "hungry ^", to figure out if you are hungry type
  1014. X"hungry".  To find out about other needy people type "rwho -h".  To
  1015. Xfind people already at lunch, type "rwho -a -h".
  1016. X
  1017. XDisclaimer:
  1018. X
  1019. XThis was written largely as a joke.  However it adds little system
  1020. Xoverhead (no additional system calls if you run rwhod) and adds a
  1021. Xlovely "ambiance" to your system.
  1022. X
  1023. XCredits:
  1024. X
  1025. XThe original idea of the HUNGRYP bit comes from JoSH's Twenex
  1026. Xultra-cusp TOPPLE.  However setting hunger was a noop since noone
  1027. Xcould see it.  I would also like to thank Sally Shepherd for
  1028. Xconvincing me that this was a "good" thing to do.
  1029. X(Sally has "hungry y" in her .login file!!)
  1030. X
  1031. X
  1032. X        Phil Budne
  1033. X        Boston University / Distributed Systems Groupies
  1034. X        budd@bu-it.bu.edu
  1035. X        ....!harvard!bu-cs!bu-it!budd
  1036. END_OF_hungry/README
  1037. if test 1050 -ne `wc -c <hungry/README`; then
  1038.     echo shar: \"hungry/README\" unpacked with wrong size!
  1039. fi
  1040. # end of overwriting check
  1041. fi
  1042. if test -f hungry/hungry.1c -a "${1}" != "-c" ; then 
  1043.   echo shar: Will not over-write existing file \"hungry/hungry.1c\"
  1044. else
  1045. echo shar: Extracting \"hungry/hungry.1c\" \(960 characters\)
  1046. sed "s/^X//" >hungry/hungry.1c <<'END_OF_hungry/hungry.1c'
  1047. X.TH HUNGRY 1C "30 May 1986"
  1048. X.ds U \fB^\fP
  1049. X.SH NAME
  1050. Xhungry \- set hunger status
  1051. X.SH SYNOPSIS
  1052. X.B hungry
  1053. X[
  1054. X.B y | n | \*U
  1055. X]
  1056. X.SH DESCRIPTION
  1057. X.I hungry
  1058. Xis a new and innovative way to find someone to lunch with, it is
  1059. Xused to inform the system as to whether you are
  1060. X.I hungry
  1061. Xor not.
  1062. XThe command:
  1063. X.RS
  1064. X.nf
  1065. X.B hungry y
  1066. X.RE
  1067. X.fi
  1068. Xsets user status to
  1069. X.I hungry.
  1070. XThe command:
  1071. X.RS
  1072. X.nf
  1073. X.B hungry n
  1074. X.RE
  1075. X.fi
  1076. Xdisables it, while:
  1077. X.RS
  1078. X.nf
  1079. X.B hungry \*U
  1080. X.RE
  1081. X.fi
  1082. Xtoggles the hungry status. Finally, the command:
  1083. X.RS
  1084. X.nf
  1085. X.B hungry
  1086. X.RE
  1087. X.fi
  1088. Xon its own tells you whether your
  1089. X.I hungry
  1090. Xstate is
  1091. X.B y
  1092. Xor
  1093. X.BR n .
  1094. XThe command 
  1095. X.B rwho -h
  1096. Xlists all 
  1097. X.I hungry
  1098. Xusers on participating systems.
  1099. X
  1100. X.LP
  1101. X.I hungry
  1102. Xoperates asynchronously.
  1103. XIt may take a minute or more for a change in
  1104. X.I hungry
  1105. Xstatus to take effect.
  1106. X
  1107. X.LP
  1108. XAll commands return the
  1109. X.I previous
  1110. Xstatus, true (0) for hungry, false satisfied.
  1111. X
  1112. X.LP
  1113. X.I hungry
  1114. Xworks by setting world execute permission on your tty.
  1115. X
  1116. X.SH SEE ALSO
  1117. Xrwho(1C)
  1118. END_OF_hungry/hungry.1c
  1119. if test 960 -ne `wc -c <hungry/hungry.1c`; then
  1120.     echo shar: \"hungry/hungry.1c\" unpacked with wrong size!
  1121. fi
  1122. # end of overwriting check
  1123. fi
  1124. if test -f hungry/hungry.c -a "${1}" != "-c" ; then 
  1125.   echo shar: Will not over-write existing file \"hungry/hungry.c\"
  1126. else
  1127. echo shar: Extracting \"hungry/hungry.c\" \(1441 characters\)
  1128. sed "s/^X//" >hungry/hungry.c <<'END_OF_hungry/hungry.c'
  1129. X/*
  1130. X *    hungry.c -- set/display hunger status
  1131. X *    Phil Budne @ Boston University / Distributed Systems
  1132. X */
  1133. X
  1134. X# include <stdio.h>
  1135. X# include <sys/types.h>
  1136. X# include <sys/stat.h>
  1137. X
  1138. X# include "hungry.h"
  1139. X
  1140. Xmain( argc, argv )
  1141. Xint argc;
  1142. Xchar *argv[];
  1143. X{
  1144. X    struct stat stb;
  1145. X    int f;
  1146. X
  1147. X    f = fileno( stderr );
  1148. X    if( !isatty( f ) ) {
  1149. X    fprintf(stderr, "?no tty\n");
  1150. X    exit( 2 );
  1151. X    } /* not a tty */
  1152. X
  1153. X    if( fstat( f, &stb ) < 0 ) {
  1154. X    perror( "fstat" );
  1155. X    exit( 2 );
  1156. X    } /* fstat failed */
  1157. X
  1158. X    if( argc < 2 ) {
  1159. X    if( (stb.st_mode & HUNGRY) != 0 )
  1160. X        puts("is y");
  1161. X    else
  1162. X        puts("is n");
  1163. X    } /* argc < 2 */
  1164. X    else {
  1165. X    int newmode;
  1166. X
  1167. X    newmode = stb.st_mode & ~S_IFMT; /* clear file format bits */
  1168. X
  1169. X    switch( argv[1][0] ) {
  1170. X    case 'y':
  1171. X        newmode |= HUNGRY;
  1172. X        break;
  1173. X
  1174. X    case 'n':
  1175. X        newmode &= ~HUNGRY;
  1176. X        break;
  1177. X
  1178. X    case '^':            /* toggle! */
  1179. X        newmode ^= HUNGRY;
  1180. X        break;
  1181. X
  1182. X    default:
  1183. X        fprintf(stderr, "%s [y n ^]\n", argv[0] );
  1184. X        exit( 2 );
  1185. X    } /* switch */
  1186. X
  1187. X# ifdef sun            /* avoid sun bug */
  1188. X    {
  1189. X        char *name;
  1190. X        extern char *ttyname();
  1191. X
  1192. X        if( (name = ttyname( f )) == NULL ) {
  1193. X        perror( "ttyname" );
  1194. X        exit( 2 );
  1195. X        } /* ttyname failed */
  1196. X
  1197. X        if( chmod(name, newmode) < 0 )
  1198. X        perror( "chmod" );
  1199. X    } /* sun */
  1200. X# else
  1201. X    if( fchmod(f, newmode) < 0 )
  1202. X        perror( "fchmod" );
  1203. X# endif not sun
  1204. X
  1205. X    } /* argv >= 2 */
  1206. X
  1207. X    if( (stb.st_mode & HUNGRY) == 0 )
  1208. X    exit( 1 );        /* false */
  1209. X    else
  1210. X    exit( 0 );        /* true */
  1211. X} /* main */
  1212. END_OF_hungry/hungry.c
  1213. if test 1441 -ne `wc -c <hungry/hungry.c`; then
  1214.     echo shar: \"hungry/hungry.c\" unpacked with wrong size!
  1215. fi
  1216. # end of overwriting check
  1217. fi
  1218. if test -f hungry/hungry.h -a "${1}" != "-c" ; then 
  1219.   echo shar: Will not over-write existing file \"hungry/hungry.h\"
  1220. else
  1221. echo shar: Extracting \"hungry/hungry.h\" \(20 characters\)
  1222. sed "s/^X//" >hungry/hungry.h <<'END_OF_hungry/hungry.h'
  1223. X# define HUNGRY 001
  1224. END_OF_hungry/hungry.h
  1225. if test 20 -ne `wc -c <hungry/hungry.h`; then
  1226.     echo shar: \"hungry/hungry.h\" unpacked with wrong size!
  1227. fi
  1228. # end of overwriting check
  1229. fi
  1230. if test -f hungry/rwho-changes -a "${1}" != "-c" ; then 
  1231.   echo shar: Will not over-write existing file \"hungry/rwho-changes\"
  1232. else
  1233. echo shar: Extracting \"hungry/rwho-changes\" \(1224 characters\)
  1234. sed "s/^X//" >hungry/rwho-changes <<'END_OF_hungry/rwho-changes'
  1235. Xin rwho.c:
  1236. X****************************************************************
  1237. Xint    aflg;
  1238. Xint    hflg;            /* budd */
  1239. X
  1240. Xmain(argc, argv)
  1241. X    int argc;
  1242. X    char **argv;
  1243. X{
  1244. X    struct direct *dp;
  1245. X    int cc, width;
  1246. X    register struct whod *w = &wd;
  1247. X    register struct whoent *we;
  1248. X    register struct myutmp *mp;
  1249. X    int f, n, i;
  1250. X
  1251. X    argc--;
  1252. X    argv++;
  1253. X    while( argc > 0 && argv[0][0] == '-' ) { /* reworked - budd */
  1254. X        switch( argv[0][1] ) {
  1255. X        case 'a':
  1256. X        aflg++;
  1257. X        break;
  1258. X        case 'h':        /* budd */
  1259. X        hflg++;
  1260. X        break;
  1261. X        }
  1262. X        argc--;
  1263. X        argv++;
  1264. X    }
  1265. X****************************************************************
  1266. X        for (n = cc / sizeof (struct whoent); n > 0; n--) {
  1267. X            if (aflg == 0 && we->we_idle >= 60*60) {
  1268. X            we++;
  1269. X            continue;
  1270. X            }
  1271. X# define HC (sizeof( we->we_utmp.out_line )-1) /* budd... */
  1272. X            if(hflg != 0 && (we->we_utmp.out_line[HC] & 0200) == 0 ) {
  1273. X            we++;
  1274. X            continue;
  1275. X            }
  1276. X            we->we_utmp.out_line[HC] &= ~0200; /* ...budd */
  1277. X
  1278. X            if (nusers >= NUSERS) {
  1279. X            printf("too many users\n");
  1280. X            exit(1);
  1281. X            }
  1282. X            mp->myutmp = we->we_utmp; mp->myidle = we->we_idle;
  1283. X            (void) strcpy(mp->myhost, w->wd_hostname);
  1284. X            nusers++; we++; mp++;
  1285. X        } /* for */
  1286. X****************************************************************
  1287. END_OF_hungry/rwho-changes
  1288. if test 1224 -ne `wc -c <hungry/rwho-changes`; then
  1289.     echo shar: \"hungry/rwho-changes\" unpacked with wrong size!
  1290. fi
  1291. # end of overwriting check
  1292. fi
  1293. if test -f hungry/rwho.1c-changes -a "${1}" != "-c" ; then 
  1294.   echo shar: Will not over-write existing file \"hungry/rwho.1c-changes\"
  1295. else
  1296. echo shar: Extracting \"hungry/rwho.1c-changes\" \(689 characters\)
  1297. sed "s/^X//" >hungry/rwho.1c-changes <<'END_OF_hungry/rwho.1c-changes'
  1298. X*** rwho.1c-3.5    Mon Jun 27 01:31:44 1988
  1299. X--- rwho.1c    Wed Jun 15 02:58:35 1988
  1300. X***************
  1301. X*** 7,12 ****
  1302. X--- 7,15 ----
  1303. X  [
  1304. X  .B \-a
  1305. X  ]
  1306. X+ [
  1307. X+ .B \-h
  1308. X+ ]
  1309. X  .SH DESCRIPTION
  1310. X  .IX  "rwho command"  ""  "\fLrwho\fP \(em who is logged in on local network"
  1311. X  .IX  "who is logged in on local network"  ""  "who is logged in on local network \(em \fLrwho\fP"
  1312. X***************
  1313. X*** 35,43 ****
  1314. X--- 38,52 ----
  1315. X  .B \-a
  1316. X  report all users whether or not they have typed to the system in the
  1317. X  past hour.
  1318. X+ .TP 
  1319. X+ .B \-h
  1320. X+ report all users who are
  1321. X+ .I hungry.
  1322. X+ 
  1323. X  .SH FILES
  1324. X  /usr/spool/rwho/whod.*        information about other machines
  1325. X  .SH SEE ALSO
  1326. X+ hungry(1C),
  1327. X  ruptime(1C),
  1328. X  rwhod(8C)
  1329. X  .SH BUGS
  1330. END_OF_hungry/rwho.1c-changes
  1331. if test 689 -ne `wc -c <hungry/rwho.1c-changes`; then
  1332.     echo shar: \"hungry/rwho.1c-changes\" unpacked with wrong size!
  1333. fi
  1334. # end of overwriting check
  1335. fi
  1336. if test -f hungry/rwhod-changes -a "${1}" != "-c" ; then 
  1337.   echo shar: Will not over-write existing file \"hungry/rwhod-changes\"
  1338. else
  1339. echo shar: Extracting \"hungry/rwhod-changes\" \(648 characters\)
  1340. sed "s/^X//" >hungry/rwhod-changes <<'END_OF_hungry/rwhod-changes'
  1341. Xin rwhod.c:
  1342. X****************************************************************
  1343. X# include "......rwhod.h"
  1344. X
  1345. X# define HUNGER 1            /* non-zero to broadcast hunger */
  1346. X# if HUNGER
  1347. X# include "hungry.h"
  1348. X# endif
  1349. X
  1350. X****************************************************************
  1351. X    for (i = 0; i < utmpent; i++) {
  1352. X        if (stat(we->we_utmp.out_line, &stb) >= 0) {
  1353. X        we->we_idle = htonl(now - stb.st_atime);
  1354. X# if HUNGER
  1355. X        if( (stb.st_mode & HUNGRY) != 0 ) /* BUDD */
  1356. X            we->we_utmp.out_line[ sizeof( we->we_utmp.out_line )-1 ]
  1357. X              |= 0200; /* BUDD */
  1358. X# endif
  1359. X        }
  1360. X        we++;
  1361. X    } /* for i */
  1362. X****************************************************************
  1363. END_OF_hungry/rwhod-changes
  1364. if test 648 -ne `wc -c <hungry/rwhod-changes`; then
  1365.     echo shar: \"hungry/rwhod-changes\" unpacked with wrong size!
  1366. fi
  1367. # end of overwriting check
  1368. fi
  1369. if test -f inet_netof.c -a "${1}" != "-c" ; then 
  1370.   echo shar: Will not over-write existing file \"inet_netof.c\"
  1371. else
  1372. echo shar: Extracting \"inet_netof.c\" \(1421 characters\)
  1373. sed "s/^X//" >inet_netof.c <<'END_OF_inet_netof.c'
  1374. X/*
  1375. X * Copyright (c) 1983 Regents of the University of California.
  1376. X * All rights reserved.
  1377. X *
  1378. X * Redistribution and use in source and binary forms are permitted
  1379. X * provided that the above copyright notice and this paragraph are
  1380. X * duplicated in all such forms and that any documentation,
  1381. X * advertising materials, and other materials related to such
  1382. X * distribution and use acknowledge that the software was developed
  1383. X * by the University of California, Berkeley.  The name of the
  1384. X * University may not be used to endorse or promote products derived
  1385. X * from this software without specific prior written permission.
  1386. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1387. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1388. X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1389. X */
  1390. X
  1391. X# if defined(LIBC_SCCS) && !defined(lint)
  1392. Xstatic char sccsid[] = "@(#)inet_netof.c    5.5 (Berkeley) 6/27/88";
  1393. X# endif /* defined(LIBC_SCCS) && !defined(lint) */
  1394. X
  1395. X# include <sys/types.h>
  1396. X# include <netinet/in.h>
  1397. X
  1398. X/*
  1399. X * Return the network number from an internet
  1400. X * address; handles class a/b/c network #'s.
  1401. X */
  1402. Xu_long
  1403. Xinet_netof(in)
  1404. X    struct in_addr in;
  1405. X{
  1406. X    register u_long i = ntohl(in.s_addr);
  1407. X
  1408. X    if (IN_CLASSA(i))
  1409. X        return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
  1410. X    else if (IN_CLASSB(i))
  1411. X        return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
  1412. X    else
  1413. X        return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
  1414. X}
  1415. END_OF_inet_netof.c
  1416. if test 1421 -ne `wc -c <inet_netof.c`; then
  1417.     echo shar: \"inet_netof.c\" unpacked with wrong size!
  1418. fi
  1419. # end of overwriting check
  1420. fi
  1421. if test -f inet_ntoa.c -a "${1}" != "-c" ; then 
  1422.   echo shar: Will not over-write existing file \"inet_ntoa.c\"
  1423. else
  1424. echo shar: Extracting \"inet_ntoa.c\" \(1335 characters\)
  1425. sed "s/^X//" >inet_ntoa.c <<'END_OF_inet_ntoa.c'
  1426. X/*
  1427. X * Copyright (c) 1983 Regents of the University of California.
  1428. X * All rights reserved.
  1429. X *
  1430. X * Redistribution and use in source and binary forms are permitted
  1431. X * provided that the above copyright notice and this paragraph are
  1432. X * duplicated in all such forms and that any documentation,
  1433. X * advertising materials, and other materials related to such
  1434. X * distribution and use acknowledge that the software was developed
  1435. X * by the University of California, Berkeley.  The name of the
  1436. X * University may not be used to endorse or promote products derived
  1437. X * from this software without specific prior written permission.
  1438. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  1439. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1440. X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  1441. X */
  1442. X
  1443. X# if defined(LIBC_SCCS) && !defined(lint)
  1444. Xstatic char sccsid[] = "@(#)inet_ntoa.c    5.4 (Berkeley) 6/27/88";
  1445. X# endif /* defined(LIBC_SCCS) && !defined(lint) */
  1446. X
  1447. X/*
  1448. X * Convert network-format internet address
  1449. X * to base 256 d.d.d.d representation.
  1450. X */
  1451. X# include <sys/types.h>
  1452. X# include <netinet/in.h>
  1453. X
  1454. Xchar *
  1455. Xinet_ntoa(in)
  1456. X    struct in_addr in;
  1457. X{
  1458. X    static char b[18];
  1459. X    register char *p;
  1460. X
  1461. X    p = (char *)∈
  1462. X# define UC(b)    (((int)b)&0xff)
  1463. X    sprintf(b, "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
  1464. X    return (b);
  1465. X}
  1466. END_OF_inet_ntoa.c
  1467. if test 1335 -ne `wc -c <inet_ntoa.c`; then
  1468.     echo shar: \"inet_ntoa.c\" unpacked with wrong size!
  1469. fi
  1470. # end of overwriting check
  1471. fi
  1472. if test -f info.h -a "${1}" != "-c" ; then 
  1473.   echo shar: Will not over-write existing file \"info.h\"
  1474. else
  1475. echo shar: Extracting \"info.h\" \(1355 characters\)
  1476. sed "s/^X//" >info.h <<'END_OF_info.h'
  1477. X/*
  1478. X * info.h -- values looked up via nlist for finger
  1479. X *
  1480. X * Copyright (C) 1986, 1990  Philip L. Budne
  1481. X *
  1482. X * This file is part of "Phil's Finger Program".
  1483. X *
  1484. X * This program is free software; you can redistribute it and/or modify
  1485. X * it under the terms of the GNU General Public License as published by
  1486. X * the Free Software Foundation; either version 1, or (at your option)
  1487. X * any later version.
  1488. X *
  1489. X */
  1490. X
  1491. X# define INFO_RCSID "$Id: info.h,v 3.0 90/07/06 13:11:03 budd Rel $"
  1492. X
  1493. X# define VERSTRLEN 80
  1494. X# ifndef _FINGER_H_
  1495. X# include "finger.h"            /* for CONC */
  1496. X# endif /* _FINGER_H_ not defined */
  1497. X
  1498. X/*
  1499. X *    this carries the creation date of syms.h but not the creation
  1500. X *    date of info.h its assumed (bad idea) that any change here
  1501. X *    will be refelected in the size of the written file.
  1502. X */
  1503. X
  1504. Xstruct info {
  1505. X    char info_fingerversion[ 2*VERSTRLEN ]; /* longversion from finger */
  1506. X                    /* (just for show) */
  1507. X    unsigned long info_kerneldate;    /* creation time of /vmunix */
  1508. X    unsigned long info_kernelsize;    /* file size of /vmunix */
  1509. X    unsigned long info_symdate;        /* creation time of syms.h */
  1510. X# define SYM(s,sc,m) unsigned long CONC(info_,m) ;
  1511. X# include "syms.h"
  1512. X# undef SYM
  1513. X# ifdef HAVE_VERSION
  1514. X    char info_verstr[ VERSTRLEN+1 ];    /* _version from kernel build */
  1515. X# endif /* HAVE_VERSION defined */
  1516. X};
  1517. X
  1518. X/*
  1519. X * Local variables:
  1520. X * comment-column: 40
  1521. X * End:
  1522. X */
  1523. END_OF_info.h
  1524. if test 1355 -ne `wc -c <info.h`; then
  1525.     echo shar: \"info.h\" unpacked with wrong size!
  1526. fi
  1527. # end of overwriting check
  1528. fi
  1529. if test -f inquire.c -a "${1}" != "-c" ; then 
  1530.   echo shar: Will not over-write existing file \"inquire.c\"
  1531. else
  1532. echo shar: Extracting \"inquire.c\" \(1640 characters\)
  1533. sed "s/^X//" >inquire.c <<'END_OF_inquire.c'
  1534. X/*
  1535. X * inquire.c -- interface from finger to inquire database (holmes)
  1536. X *    October 1986
  1537. X *
  1538. X * Copyright (C) 1988, 1990  Philip L. Budne
  1539. X *
  1540. X * This file is part of "Phil's Finger Program".
  1541. X *
  1542. X * This program is free software; you can redistribute it and/or modify
  1543. X * it under the terms of the GNU General Public License as published by
  1544. X * the Free Software Foundation; either version 1, or (at your option)
  1545. X * any later version.
  1546. X *
  1547. X */
  1548. X
  1549. X# ifndef lint
  1550. Xstatic char *rcsid = "$Id: inquire.c,v 3.0 90/07/06 13:11:05 budd Rel $";
  1551. X# endif /* lint not defined */
  1552. X
  1553. X# include "finger.h"
  1554. X# ifdef INQUIRE                /* entire file! */
  1555. X# include <stdio.h>
  1556. X# include "inquire.h"
  1557. X# include "person.h"
  1558. X# include "args.h"
  1559. X
  1560. X
  1561. X# define W(x,y) (pp->CONC(p_,x) = y)
  1562. X# define X(x,y) W(x,savestr(bps[y]))
  1563. X# define Y(x,y) if( bps[y][0] != EOS ) X(x,y); else W(x,NULL)
  1564. X# define Z(x,y,z) if( bps[y][0] != EOS ) W(x,bps[y][0]); else W(x,z)
  1565. X
  1566. XGLOBAL int doinquire( user, pp, bps )
  1567. Xchar *user;
  1568. Xregister PERSON *pp;
  1569. Xregister char *bps[];
  1570. X{
  1571. X    if( bps == NULL ) {
  1572. X    if( Read( user, BPs ) == NULL )
  1573. X        return( FALSE );
  1574. X    bps = BPs;
  1575. X    }
  1576. X
  1577. X    if( bps[_PNAME][0] != EOS ) {
  1578. X    char buf[ 120 ];
  1579. X    npname( buf, bps[_PNAME]);
  1580. X    pp->p_personal = savestr( buf );
  1581. X    }
  1582. X
  1583. X    Z(group,_GROUP,'?');
  1584. X    Z(relation,_REL,'?');
  1585. X
  1586. X    if( !sw_whois )
  1587. X    return( TRUE );
  1588. X
  1589. X    Y(waddr,_WADDR);
  1590. X    Y(haddr,_HADDR);
  1591. X
  1592. X    Y(wphone,_WPHON);
  1593. X    Y(hphone,_HPHON);
  1594. X
  1595. X    Y(project,_PROJ);
  1596. X    Y(supervisor,_SUPER);
  1597. X
  1598. X    Y(nickname,_NNAME);
  1599. X    Y(birthday,_BIRTH);
  1600. X    Y(remarks,_REM);
  1601. X
  1602. X    return( TRUE );
  1603. X} /* doinquire */
  1604. X# endif /* INQUIRE defined */
  1605. X
  1606. X/*
  1607. X * Local variables:
  1608. X * comment-column: 40
  1609. X * End:
  1610. X */
  1611. END_OF_inquire.c
  1612. if test 1640 -ne `wc -c <inquire.c`; then
  1613.     echo shar: \"inquire.c\" unpacked with wrong size!
  1614. fi
  1615. # end of overwriting check
  1616. fi
  1617. if test -f inquire.h -a "${1}" != "-c" ; then 
  1618.   echo shar: Will not over-write existing file \"inquire.h\"
  1619. else
  1620. echo shar: Extracting \"inquire.h\" \(700 characters\)
  1621. sed "s/^X//" >inquire.h <<'END_OF_inquire.h'
  1622. X/*
  1623. X * Copyright (C) 1988, 1990  Philip L. Budne
  1624. X *
  1625. X * This file is part of "Phil's Finger Program".
  1626. X *
  1627. X * This program is free software; you can redistribute it and/or modify
  1628. X * it under the terms of the GNU General Public License as published by
  1629. X * the Free Software Foundation; either version 1, or (at your option)
  1630. X * any later version.
  1631. X *
  1632. X */
  1633. X
  1634. X# define INQUIRE_RCSID "$Id: inquire.h,v 3.0 90/07/06 13:11:07 budd Rel $"
  1635. X
  1636. X# ifdef INQUIRE
  1637. X# include "hakinq/helper.h"    /* PROTO() */
  1638. X# include "hakinq/fields.h"
  1639. X# include "hakinq/buffer.h"
  1640. X
  1641. X# include "hakinq/person.h"    /* one or the other */
  1642. X# include "hakinq/user.h"
  1643. X# include "hakinq/lose.h"
  1644. X
  1645. X# define INQ_INFO char **
  1646. X
  1647. X# endif /* INQUIRE defined */
  1648. END_OF_inquire.h
  1649. if test 700 -ne `wc -c <inquire.h`; then
  1650.     echo shar: \"inquire.h\" unpacked with wrong size!
  1651. fi
  1652. # end of overwriting check
  1653. fi
  1654. if test -f kmem.h -a "${1}" != "-c" ; then 
  1655.   echo shar: Will not over-write existing file \"kmem.h\"
  1656. else
  1657. echo shar: Extracting \"kmem.h\" \(1544 characters\)
  1658. sed "s/^X//" >kmem.h <<'END_OF_kmem.h'
  1659. X/*
  1660. X * kmem.h -- interface to kmem.c
  1661. X *
  1662. X * Copyright (C) 1986, 1990  Philip L. Budne
  1663. X *
  1664. X * This file is part of "Phil's Finger Program".
  1665. X *
  1666. X * This program is free software; you can redistribute it and/or modify
  1667. X * it under the terms of the GNU General Public License as published by
  1668. X * the Free Software Foundation; either version 1, or (at your option)
  1669. X * any later version.
  1670. X *
  1671. X */
  1672. X
  1673. X# define KMEM_RCSID "$Id: kmem.h,v 3.0 90/07/06 13:11:11 budd Rel $"
  1674. X
  1675. X# if SunOS >= 400
  1676. X# include <kvm.h>
  1677. X# define FTYPE kvm_t *
  1678. X# define KMEMREAD(p,b,l) kvm_read(kmem, p, b, l)
  1679. X# define ISBADFILE(f) ((f) == NULL)
  1680. X# else  /* not SunOS >= 400 */
  1681. X
  1682. X# define BUFIO 0        /* total lose */
  1683. X
  1684. X# if BUFIO
  1685. X# define ISBADFILE(f) (f == NULL)
  1686. X# define BADFILE NULL
  1687. X# define FTYPE FILE *
  1688. X# define OPEN(n) fopen(n, "r")
  1689. X# define CLOSE(f) fclose(f)
  1690. X# define READ(f,buf,cnt) fread(buf,cnt,1,f)
  1691. X# define SEEK(f,o,w) fseek(f,o,w)
  1692. X# define FILENO(f) fileno(f)
  1693. X# else  /* not BUFIO */
  1694. X# define ISBADFILE(f) (f < 0)
  1695. X# define BADFILE -1
  1696. X# define FTYPE int
  1697. X# define CLOSE(f) close(f)
  1698. X# define OPEN(n) open(n, 0)
  1699. X# define READ(f,buf,cnt) read(f,buf,cnt)
  1700. X# define SEEK(f,o,w) lseek(f,o,w)
  1701. X# define FILENO(f) (f)
  1702. X# endif /* not BUFIO */
  1703. X
  1704. X# ifdef sgi
  1705. X/* Bletch! remove K0BASE.  works for K0 and K2 addrs */
  1706. X# define KVADDR(p) (((unsigned long)(p)) & ~0x80000000 )
  1707. X# else  /* sgi not defined */
  1708. X# define KVADDR(p) (p)
  1709. X# endif /* sgi not defined */
  1710. X
  1711. X# define KMEMREAD(p,b,l) kread(kmem, KVADDR(p), b, l)
  1712. X# endif /* not SunOS >= 400 */
  1713. X
  1714. X/*
  1715. X * Local variables:
  1716. X * comment-column: 40
  1717. X * End:
  1718. X */
  1719. END_OF_kmem.h
  1720. if test 1544 -ne `wc -c <kmem.h`; then
  1721.     echo shar: \"kmem.h\" unpacked with wrong size!
  1722. fi
  1723. # end of overwriting check
  1724. fi
  1725. if test -f locname.c -a "${1}" != "-c" ; then 
  1726.   echo shar: Will not over-write existing file \"locname.c\"
  1727. else
  1728. echo shar: Extracting \"locname.c\" \(1083 characters\)
  1729. sed "s/^X//" >locname.c <<'END_OF_locname.c'
  1730. X/*
  1731. X * locname.c -- create ttyloc file paths for ttyloc.c and finger
  1732. X *
  1733. X * Copyright (C) 1986, 1990  Philip L. Budne
  1734. X *
  1735. X * This file is part of "Phil's Finger Program".
  1736. X *
  1737. X * This program is free software; you can redistribute it and/or modify
  1738. X * it under the terms of the GNU General Public License as published by
  1739. X * the Free Software Foundation; either version 1, or (at your option)
  1740. X * any later version.
  1741. X *
  1742. X */
  1743. X
  1744. X# ifndef lint
  1745. Xstatic char *rcsid = "$Id: locname.c,v 3.0 90/07/06 13:11:15 budd Rel $";
  1746. X# endif /* lint not defined */
  1747. X
  1748. X# include "finger.h"
  1749. X
  1750. Xextern char localhost[];
  1751. X
  1752. XLOCAL char *_locname(type, ttyname)
  1753. X    char *type, *ttyname;
  1754. X{
  1755. X    static char buffer[200];
  1756. X    sprintf(buffer, "%s/%s_%s_%s", TTYLOC_DIR, type, localhost, ttyname);
  1757. X    return( buffer );
  1758. X} /* _locname */
  1759. X
  1760. XGLOBAL char *locname( ttyname )
  1761. X    char *ttyname;
  1762. X{
  1763. X    return( _locname("ttyloc", ttyname ) );
  1764. X} /* locname */
  1765. X
  1766. XGLOBAL char *netlocname( ttyname )
  1767. X    char *ttyname;
  1768. X{
  1769. X    return( _locname("netloc", ttyname ) );
  1770. X} /* netlocname */
  1771. X
  1772. X
  1773. X/*
  1774. X * Local variables:
  1775. X * comment-column: 40
  1776. X * End:
  1777. X */
  1778. END_OF_locname.c
  1779. if test 1083 -ne `wc -c <locname.c`; then
  1780.     echo shar: \"locname.c\" unpacked with wrong size!
  1781. fi
  1782. # end of overwriting check
  1783. fi
  1784. if test -f make-version -a "${1}" != "-c" ; then 
  1785.   echo shar: Will not over-write existing file \"make-version\"
  1786. else
  1787. echo shar: Extracting \"make-version\" \(1240 characters\)
  1788. sed "s/^X//" >make-version <<'END_OF_make-version'
  1789. X#! /bin/sh
  1790. X# 
  1791. X# make-version -- shell script to create version.c for finger
  1792. X#
  1793. X# Copyright (C) 1987, 1990  Philip L. Budne
  1794. X#
  1795. X# This file is part of "Phil's Finger Program".
  1796. X#
  1797. X# This program is free software; you can redistribute it and/or modify
  1798. X# it under the terms of the GNU General Public License as published by
  1799. X# the Free Software Foundation; either version 1, or (at your option)
  1800. X# any later version.
  1801. X#
  1802. X
  1803. X# $Id: make-version,v 3.0 90/07/06 13:11:18 budd Rel $
  1804. X
  1805. Xif [ -r BUILD ]
  1806. Xthen
  1807. X    build=`cat BUILD`
  1808. X    if expr $build + 1 > /dev/null 2>&1
  1809. X    then
  1810. X    build=`expr $build + 1`
  1811. X    else
  1812. X    echo bad BUILD file '"'$build'"' -- resetting 1>&2
  1813. X    build=1
  1814. X    fi
  1815. Xelse
  1816. X    echo creating new BUILD file 1>&2
  1817. X    build=1
  1818. Xfi
  1819. Xecho $build > BUILD
  1820. Xecho build $build 1>&2
  1821. X
  1822. Xecho '/* This file is created by the script make-version */'
  1823. Xif test -f /bin/hostname ; then
  1824. X    HOST=`/bin/hostname`
  1825. Xelse
  1826. X    HOST=`/bin/uname -n`
  1827. Xfi
  1828. X
  1829. Xcat <<EOF
  1830. Xchar version[]         = "`./pversion`";
  1831. Xchar build_who[]    = "`./mywhoami`";
  1832. Xchar build_host[]    = "$HOST";
  1833. Xchar build_dir[]    = "`pwd`";
  1834. Xchar build_date[]    = "`date`";
  1835. Xint  build_number    = $build;
  1836. X
  1837. Xchar longversion[]    = "This is finger version `./pversion` build #$build by `./mywhoami` at $HOST\non `date` in `pwd`";
  1838. XEOF
  1839. Xexit 0
  1840. END_OF_make-version
  1841. if test 1240 -ne `wc -c <make-version`; then
  1842.     echo shar: \"make-version\" unpacked with wrong size!
  1843. fi
  1844. chmod +x make-version
  1845. # end of overwriting check
  1846. fi
  1847. if test -f myecho.c -a "${1}" != "-c" ; then 
  1848.   echo shar: Will not over-write existing file \"myecho.c\"
  1849. else
  1850. echo shar: Extracting \"myecho.c\" \(909 characters\)
  1851. sed "s/^X//" >myecho.c <<'END_OF_myecho.c'
  1852. X/*
  1853. X * myecho.c -- avoid Sys V compatible echo (interprets \n) for make-version
  1854. X *
  1855. X * Copyright (C) 1988, 1990  Philip L. Budne
  1856. X *
  1857. X * This file is part of "Phil's Finger Program".
  1858. X *
  1859. X * This program is free software; you can redistribute it and/or modify
  1860. X * it under the terms of the GNU General Public License as published by
  1861. X * the Free Software Foundation; either version 1, or (at your option)
  1862. X * any later version.
  1863. X *
  1864. X */
  1865. X
  1866. X# ifndef lint
  1867. Xstatic char *rcsid = "$Id: myecho.c,v 3.0 90/07/06 13:11:21 budd Rel $";
  1868. X# endif /* lint not defined */
  1869. X
  1870. X# include <stdio.h>
  1871. X# include "finger.h"
  1872. X
  1873. Xmain( c, v )
  1874. X    int c;
  1875. X    char **v;
  1876. X{
  1877. X    int i, newline;
  1878. X    c--;
  1879. X    v++;
  1880. X
  1881. X    newline = 1;
  1882. X    if( strcmp( *v, "-n" ) == 0 ) {
  1883. X    c--;
  1884. X    v++;
  1885. X    newline = 0;
  1886. X    }
  1887. X    while( c-- > 0 ) {
  1888. X    if( i++ > 0 )
  1889. X        putchar(' ');
  1890. X    printf("%s", *v++ );
  1891. X    } /* for */
  1892. X    if( newline )
  1893. X    putchar('\n');
  1894. X    exit( 0 );
  1895. X} /* main */
  1896. END_OF_myecho.c
  1897. if test 909 -ne `wc -c <myecho.c`; then
  1898.     echo shar: \"myecho.c\" unpacked with wrong size!
  1899. fi
  1900. # end of overwriting check
  1901. fi
  1902. if test -f mywhoami.c -a "${1}" != "-c" ; then 
  1903.   echo shar: Will not over-write existing file \"mywhoami.c\"
  1904. else
  1905. echo shar: Extracting \"mywhoami.c\" \(1022 characters\)
  1906. sed "s/^X//" >mywhoami.c <<'END_OF_mywhoami.c'
  1907. X/*
  1908. X * mywhoami.c -- whoami for makefile/make-version on USG systems
  1909. X *
  1910. X * Copyright (C) 1989, 1990  Philip L. Budne
  1911. X *
  1912. X * This file is part of "Phil's Finger Program".
  1913. X *
  1914. X * This program is free software; you can redistribute it and/or modify
  1915. X * it under the terms of the GNU General Public License as published by
  1916. X * the Free Software Foundation; either version 1, or (at your option)
  1917. X * any later version.
  1918. X *
  1919. X */
  1920. X
  1921. X# ifndef lint
  1922. Xstatic char *rcsid = "$Id: mywhoami.c,v 3.0 90/07/06 13:11:22 budd Rel $";
  1923. Xstatic char Copyright[] = "Copyright (C) 1986, 1990  Philip L. Budne";
  1924. X# endif /* lint not defined */
  1925. X
  1926. X# include <stdio.h>
  1927. X# include <pwd.h>
  1928. X
  1929. Xextern char *getenv();
  1930. Xextern struct passwd *getpwuid();    /* USG pwd.h */
  1931. X
  1932. X# define IFENV(v) if( (e = getenv(v)) != NULL ) puts( e )
  1933. X
  1934. Xint
  1935. Xmain() {
  1936. X    struct passwd *pw;
  1937. X    char *e;
  1938. X
  1939. X    if( (pw = getpwuid( getuid())) != NULL )
  1940. X    puts( pw->pw_name );
  1941. X    else IFENV( "USER" );
  1942. X    else IFENV( "LOGNAME" );
  1943. X    else
  1944. X    puts("???");
  1945. X    return( 0 );            /* be ANSI */
  1946. X} /* main */
  1947. X
  1948. END_OF_mywhoami.c
  1949. if test 1022 -ne `wc -c <mywhoami.c`; then
  1950.     echo shar: \"mywhoami.c\" unpacked with wrong size!
  1951. fi
  1952. # end of overwriting check
  1953. fi
  1954. if test -f output.h -a "${1}" != "-c" ; then 
  1955.   echo shar: Will not over-write existing file \"output.h\"
  1956. else
  1957. echo shar: Extracting \"output.h\" \(570 characters\)
  1958. sed "s/^X//" >output.h <<'END_OF_output.h'
  1959. X/*
  1960. X * output.h -- output defns for new finger
  1961. X *
  1962. X * Copyright (C) 1986, 1990  Philip L. Budne
  1963. X *
  1964. X * This file is part of "Phil's Finger Program".
  1965. X *
  1966. X * This program is free software; you can redistribute it and/or modify
  1967. X * it under the terms of the GNU General Public License as published by
  1968. X * the Free Software Foundation; either version 1, or (at your option)
  1969. X * any later version.
  1970. X *
  1971. X */
  1972. X
  1973. X# define OUTPUT_RCSID "$Id: output.h,v 3.0 90/07/06 13:11:31 budd Rel $"
  1974. X
  1975. X# define MAXLINE 200
  1976. X# define OUTPUT stdout
  1977. X
  1978. X/*
  1979. X * Local variables:
  1980. X * comment-column: 40
  1981. X * End:
  1982. X */
  1983. END_OF_output.h
  1984. if test 570 -ne `wc -c <output.h`; then
  1985.     echo shar: \"output.h\" unpacked with wrong size!
  1986. fi
  1987. # end of overwriting check
  1988. fi
  1989. if test -f person.h -a "${1}" != "-c" ; then 
  1990.   echo shar: Will not over-write existing file \"person.h\"
  1991. else
  1992. echo shar: Extracting \"person.h\" \(1752 characters\)
  1993. sed "s/^X//" >person.h <<'END_OF_person.h'
  1994. X/*
  1995. X * person.h -- person structure for finger (per username)
  1996. X *    December 1985
  1997. X *
  1998. X * Copyright (C) 1986, 1990  Philip L. Budne
  1999. X *
  2000. X * This file is part of "Phil's Finger Program".
  2001. X *
  2002. X * This program is free software; you can redistribute it and/or modify
  2003. X * it under the terms of the GNU General Public License as published by
  2004. X * the Free Software Foundation; either version 1, or (at your option)
  2005. X * any later version.
  2006. X *
  2007. X */
  2008. X
  2009. X# define PERSON_RCSID "$Id: person.h,v 3.0 90/07/06 13:11:32 budd Rel $"
  2010. X
  2011. X# ifdef _PERSON_
  2012. X    OOPS!!            /* loaded twice, or luser.h loaded first!! */
  2013. X# endif /* _PERSON_ defined */
  2014. X# define _PERSON_        /* say we have loaded! */
  2015. X
  2016. X# define PLEN 33        /* personal name length */
  2017. X
  2018. Xtypedef struct person {
  2019. X    short p_count;        /* use count */
  2020. X    short p_uid, p_gid;        /* user id, group id */
  2021. X
  2022. X    short p_flags;
  2023. X# define P_RC        01    /* gecos == "RC" */
  2024. X# define P_INQUIRE    02    /* data came from inquire/holmes */
  2025. X# define P_NOPWENT    04    /* no passwd entry */
  2026. X
  2027. X    char *p_home;        /* home directory */
  2028. X    char *p_shell;        /* default shell */
  2029. X
  2030. X    char *p_personal;        /* personal name */
  2031. X    char *p_waddr;        /* work address */
  2032. X    char *p_wphone;        /* work phone */
  2033. X    char *p_hphone;        /* home phone */
  2034. X
  2035. X/* below here not from password file */
  2036. X    char *p_project;        /* first line of .project */
  2037. X    char *p_maddr;        /* mailing address (from .forward) */
  2038. X
  2039. X/* below here from inquire database */
  2040. X    char *p_supervisor;        /* yes */
  2041. X    char *p_nickname;        /* what I like to be called */
  2042. X    char *p_birthday;        /* yes */
  2043. X    char *p_haddr;        /* home address */
  2044. X    char *p_remarks;        /* clever stuff here */
  2045. X    char p_group;        /* user group */
  2046. X    char p_relation;        /* relation to group */
  2047. X} PERSON;
  2048. X
  2049. X/*
  2050. X * Local variables:
  2051. X * comment-column: 40
  2052. X * End:
  2053. X */
  2054. END_OF_person.h
  2055. if test 1752 -ne `wc -c <person.h`; then
  2056.     echo shar: \"person.h\" unpacked with wrong size!
  2057. fi
  2058. # end of overwriting check
  2059. fi
  2060. if test -f pr.h -a "${1}" != "-c" ; then 
  2061.   echo shar: Will not over-write existing file \"pr.h\"
  2062. else
  2063. echo shar: Extracting \"pr.h\" \(1591 characters\)
  2064. sed "s/^X//" >pr.h <<'END_OF_pr.h'
  2065. X/*
  2066. X * pr.h -- process table structure for finger
  2067. X *
  2068. X * Copyright (C) 1986, 1990  Philip L. Budne
  2069. X *
  2070. X * This file is part of "Phil's Finger Program".
  2071. X *
  2072. X * This program is free software; you can redistribute it and/or modify
  2073. X * it under the terms of the GNU General Public License as published by
  2074. X * the Free Software Foundation; either version 1, or (at your option)
  2075. X * any later version.
  2076. X *
  2077. X */
  2078. X
  2079. X# define PR_RCSID "$Id: pr.h,v 3.0 90/07/06 13:11:33 budd Rel $"
  2080. X
  2081. Xenum sig { S_DEFAULT=1, S_IGNORE, S_CATCH, S_HOLD };
  2082. X# define SIGNAME "?DICH?"
  2083. X
  2084. Xstruct pr {
  2085. X    /* from proc struct */
  2086. X    short pr_pid;            /* proc.p_pid   process pid */
  2087. X    short pr_ppid;            /* proc.p_ppid  parent pid */
  2088. X    short pr_pgrp;            /* proc.p_pgrp  pgrp leader pid */
  2089. X    short pr_uid;            /* proc.p_uid   userid */
  2090. X    char pr_flag;            /* proc.p_flag  process flags (SWAP) */
  2091. X    caddr_t pr_wchan;            /* proc.p_wchan wait addr */
  2092. X    char pr_stat;            /* proc.p_stat  state 1..6 */
  2093. X
  2094. X    /* from user struct */
  2095. X    dev_t pr_ttyd;            /* user.u_ttyd  tty device of process */
  2096. X    char pr_cmd[15];            /* user.u_comm  command name */
  2097. X# ifdef SHORT_TTYP
  2098. X    short *pr_ttyp;            /* user.u_ttyp  ptr to tpg in stream */
  2099. X# else  /* SHORT_TTYP not defined */
  2100. X    struct tty *pr_ttyp;        /* user.u_ttyp  pointer to tty str */
  2101. X# endif /* SHORT_TTYP not defined */
  2102. X    enum sig pr_intr,            /* state of SIGINT */
  2103. X         pr_quit,            /* state of SIGQUIT */
  2104. X         pr_hup;            /* state of SIGHUP */
  2105. X
  2106. X    /* derived */
  2107. X    SIGNED long pr_weight;        /* heuristic display weight */
  2108. X};
  2109. X
  2110. Xvoid dumppr();
  2111. X/*
  2112. X * Local variables:
  2113. X * comment-column: 40
  2114. X * End:
  2115. X */
  2116. END_OF_pr.h
  2117. if test 1591 -ne `wc -c <pr.h`; then
  2118.     echo shar: \"pr.h\" unpacked with wrong size!
  2119. fi
  2120. # end of overwriting check
  2121. fi
  2122. if test -f pversion.c -a "${1}" != "-c" ; then 
  2123.   echo shar: Will not over-write existing file \"pversion.c\"
  2124. else
  2125. echo shar: Extracting \"pversion.c\" \(1082 characters\)
  2126. sed "s/^X//" >pversion.c <<'END_OF_pversion.c'
  2127. X/*
  2128. X * pversion -- display finger version for build procedure
  2129. X *
  2130. X * Copyright (C) 1986, 1990  Philip L. Budne
  2131. X *
  2132. X * This file is part of "Phil's Finger Program".
  2133. X *
  2134. X * This program is free software; you can redistribute it and/or modify
  2135. X * it under the terms of the GNU General Public License as published by
  2136. X * the Free Software Foundation; either version 1, or (at your option)
  2137. X * any later version.
  2138. X *
  2139. X */
  2140. X
  2141. X# include "finger.h"
  2142. X# include "History.h"
  2143. X
  2144. X# ifndef lint
  2145. Xstatic char *history_rcsid = HISTORY_RCSID;
  2146. Xstatic char *rcsid = "$Id: pversion.c,v 3.0 90/07/06 13:11:35 budd Rel $";
  2147. X# endif /* lint not defined */
  2148. X
  2149. Xint main() {
  2150. X    printf("%o", ver.major );
  2151. X    if( ver.minor != 0 ) {
  2152. X    int m1;
  2153. X    if( ver.minor > 25 ) {
  2154. X        m1 = ver.minor / 26;
  2155. X        if( m1 > 26 )
  2156. X        m1 = 26;
  2157. X        printf("%c", 'A' + m1 - 1 );
  2158. X        ver.minor %= 26;
  2159. X    } /* more than one letter? */
  2160. X    printf("%c", 'A' + ver.minor - 1 );
  2161. X    } /* minor version */
  2162. X    printf("(%o)", ver.edit );
  2163. X    if( ver.who != 0 )
  2164. X    printf("-%o", ver.who );
  2165. X    puts("");
  2166. X    return( 0 );            /* be a good ANSI program */
  2167. X} /* main */
  2168. END_OF_pversion.c
  2169. if test 1082 -ne `wc -c <pversion.c`; then
  2170.     echo shar: \"pversion.c\" unpacked with wrong size!
  2171. fi
  2172. # end of overwriting check
  2173. fi
  2174. if test -f remote.h -a "${1}" != "-c" ; then 
  2175.   echo shar: Will not over-write existing file \"remote.h\"
  2176. else
  2177. echo shar: Extracting \"remote.h\" \(876 characters\)
  2178. sed "s/^X//" >remote.h <<'END_OF_remote.h'
  2179. X/*
  2180. X * remote.h -- structs for remote user input
  2181. X *
  2182. X * Copyright (C) 1986, 1990  Philip L. Budne
  2183. X *
  2184. X * This file is part of "Phil's Finger Program".
  2185. X *
  2186. X * This program is free software; you can redistribute it and/or modify
  2187. X * it under the terms of the GNU General Public License as published by
  2188. X * the Free Software Foundation; either version 1, or (at your option)
  2189. X * any later version.
  2190. X *
  2191. X */
  2192. X
  2193. X# define REMOTE_RCSID "$Id: remote.h,v 3.0 90/07/06 13:11:40 budd Rel $"
  2194. X
  2195. Xtypedef struct rhost {
  2196. X    char *rh_name;            /* host name */
  2197. X    struct rhost *rh_next;        /* next host in chain */
  2198. X    struct ruser *rh_user;        /* pointer to user chain */
  2199. X    struct ruser *rh_endu;        /* end of user chain */
  2200. X} RHOST;
  2201. X
  2202. Xtypedef struct ruser {
  2203. X    char *ru_name;            /* user name */
  2204. X    struct ruser *ru_next;        /* next in chain */
  2205. X} RUSER;
  2206. X
  2207. X/*
  2208. X * Local variables:
  2209. X * comment-column: 40
  2210. X * End:
  2211. X */
  2212. END_OF_remote.h
  2213. if test 876 -ne `wc -c <remote.h`; then
  2214.     echo shar: \"remote.h\" unpacked with wrong size!
  2215. fi
  2216. # end of overwriting check
  2217. fi
  2218. if test -f skip.c -a "${1}" != "-c" ; then 
  2219.   echo shar: Will not over-write existing file \"skip.c\"
  2220. else
  2221. echo shar: Extracting \"skip.c\" \(1052 characters\)
  2222. sed "s/^X//" >skip.c <<'END_OF_skip.c'
  2223. X/*
  2224. X * skip.c -- skip white and non (July 1987)
  2225. X *
  2226. X * Copyright (C) 1986, 1990  Philip L. Budne
  2227. X *
  2228. X * This file is part of "Phil's Finger Program".
  2229. X *
  2230. X * This program is free software; you can redistribute it and/or modify
  2231. X * it under the terms of the GNU General Public License as published by
  2232. X * the Free Software Foundation; either version 1, or (at your option)
  2233. X * any later version.
  2234. X *
  2235. X */
  2236. X
  2237. X# ifndef lint
  2238. Xstatic char *rcsid = "$Id: skip.c,v 3.0 90/07/06 13:11:43 budd Rel $";
  2239. X# endif /* lint not defined */
  2240. X
  2241. X# include <ctype.h>
  2242. X# include "finger.h"
  2243. X
  2244. XGLOBAL int skipwhite( cpp )
  2245. Xchar **cpp;
  2246. X{
  2247. X    register char *cp = *cpp;
  2248. X    while( *cp != EOS && isspace( *cp ) )
  2249. X    cp++;
  2250. X    *cpp = cp;
  2251. X    if( *cp == EOS )
  2252. X    return( FALSE );
  2253. X    else
  2254. X    return( TRUE );
  2255. X} /* skipwhite */
  2256. X
  2257. XGLOBAL int skipblack( cpp )
  2258. Xchar **cpp;
  2259. X{
  2260. X    register char *cp = *cpp;
  2261. X    while( *cp != EOS && !isspace( *cp ) )
  2262. X    cp++;
  2263. X    *cpp = cp;
  2264. X    if( *cp == EOS )
  2265. X    return( FALSE );
  2266. X    else
  2267. X    return( TRUE );
  2268. X} /* skipblack */
  2269. X
  2270. X/*
  2271. X * Local variables:
  2272. X * comment-column: 40
  2273. X * End:
  2274. X */
  2275. END_OF_skip.c
  2276. if test 1052 -ne `wc -c <skip.c`; then
  2277.     echo shar: \"skip.c\" unpacked with wrong size!
  2278. fi
  2279. # end of overwriting check
  2280. fi
  2281. if test -f strings.h -a "${1}" != "-c" ; then 
  2282.   echo shar: Will not over-write existing file \"strings.h\"
  2283. else
  2284. echo shar: Extracting \"strings.h\" \(790 characters\)
  2285. sed "s/^X//" >strings.h <<'END_OF_strings.h'
  2286. X/*
  2287. X * strings.h - help for systems without old style string functions
  2288. X *
  2289. X * Copyright (C) 1989, 1990  Philip L. Budne
  2290. X *
  2291. X * This file is part of "Phil's Finger Program".
  2292. X *
  2293. X * This program is free software; you can redistribute it and/or modify
  2294. X * it under the terms of the GNU General Public License as published by
  2295. X * the Free Software Foundation; either version 1, or (at your option)
  2296. X * any later version.
  2297. X *
  2298. X */
  2299. X
  2300. X# define STRINGS_RCSID "$Id: strings.h,v 3.0 90/07/06 13:11:47 budd Rel $"
  2301. X
  2302. X# ifndef _STRINGS_H_
  2303. X# define _STRINGS_H_
  2304. X
  2305. X# include <string.h>            /* sigh.. nested include */
  2306. X# define index(s,c) strchr(s,c)
  2307. X# define rindex(s,c) strrchr(s,c)    /* what a dumb name! */
  2308. X
  2309. X# define bzero(s,c) memset(s,'\0',c)
  2310. X# define bcopy(s,d,c) memcpy(d,s,c)
  2311. X# endif /* _STRINGS_H_ not defined */
  2312. END_OF_strings.h
  2313. if test 790 -ne `wc -c <strings.h`; then
  2314.     echo shar: \"strings.h\" unpacked with wrong size!
  2315. fi
  2316. # end of overwriting check
  2317. fi
  2318. if test -f symdate.c -a "${1}" != "-c" ; then 
  2319.   echo shar: Will not over-write existing file \"symdate.c\"
  2320. else
  2321. echo shar: Extracting \"symdate.c\" \(947 characters\)
  2322. sed "s/^X//" >symdate.c <<'END_OF_symdate.c'
  2323. X/*
  2324. X * symdate.c -- stand alone prog to write symdate.h
  2325. X *
  2326. X * Copyright (C) 1986, 1990  Philip L. Budne
  2327. X *
  2328. X * This file is part of "Phil's Finger Program".
  2329. X *
  2330. X * This program is free software; you can redistribute it and/or modify
  2331. X * it under the terms of the GNU General Public License as published by
  2332. X * the Free Software Foundation; either version 1, or (at your option)
  2333. X * any later version.
  2334. X *
  2335. X */
  2336. X
  2337. X# ifndef lint
  2338. Xstatic char *rcsid = "$Id: symdate.c,v 3.0 90/07/06 13:11:52 budd Rel $";
  2339. X# endif /* lint not defined */
  2340. X
  2341. X# include <stdio.h>
  2342. X# include <sys/types.h>
  2343. X# include <sys/stat.h>
  2344. X# include "finger.h"
  2345. X
  2346. Xmain(argc, argv)
  2347. Xint argc;
  2348. Xchar *argv[];
  2349. X{
  2350. X    struct stat stb;
  2351. X
  2352. X    if( argc != 2 )
  2353. X    fprintf(stderr, "%s file\n", argv[0] );
  2354. X    else if( stat( argv[1], &stb ) < 0 )
  2355. X    perror( argv[1] );
  2356. X    else {
  2357. X    printf("%ld\n", stb.st_mtime );
  2358. X    exit( 0 );
  2359. X    }
  2360. X    exit( 1 );
  2361. X} /* main */
  2362. X
  2363. X/*
  2364. X * Local variables:
  2365. X * comment-column: 40
  2366. X * End:
  2367. X */
  2368. END_OF_symdate.c
  2369. if test 947 -ne `wc -c <symdate.c`; then
  2370.     echo shar: \"symdate.c\" unpacked with wrong size!
  2371. fi
  2372. # end of overwriting check
  2373. fi
  2374. if test -f tsel.h -a "${1}" != "-c" ; then 
  2375.   echo shar: Will not over-write existing file \"tsel.h\"
  2376. else
  2377. echo shar: Extracting \"tsel.h\" \(739 characters\)
  2378. sed "s/^X//" >tsel.h <<'END_OF_tsel.h'
  2379. X/*
  2380. X * tsel.h -- structures for user input "terminal selectors"
  2381. X *
  2382. X * Copyright (C) 1987, 1990  Philip L. Budne
  2383. X *
  2384. X * This file is part of "Phil's Finger Program".
  2385. X *
  2386. X * This program is free software; you can redistribute it and/or modify
  2387. X * it under the terms of the GNU General Public License as published by
  2388. X * the Free Software Foundation; either version 1, or (at your option)
  2389. X * any later version.
  2390. X *
  2391. X */
  2392. X
  2393. X# define TSEL_RCSID "$Id: tsel.h,v 3.0 90/07/06 13:11:55 budd Rel $"
  2394. X
  2395. Xtypedef struct tsel {
  2396. X    char    *ts_name;        /* name of selector */
  2397. X    short    ts_len;            /* length of string */
  2398. X    short    ts_len2;        /* length - 3 */
  2399. X    struct tsel *ts_next;        /* next in chain */
  2400. X} TSEL;
  2401. X
  2402. X/*
  2403. X * Local variables:
  2404. X * comment-column: 40
  2405. X * End:
  2406. X */
  2407. END_OF_tsel.h
  2408. if test 739 -ne `wc -c <tsel.h`; then
  2409.     echo shar: \"tsel.h\" unpacked with wrong size!
  2410. fi
  2411. # end of overwriting check
  2412. fi
  2413. if test -f ttylocfile.h -a "${1}" != "-c" ; then 
  2414.   echo shar: Will not over-write existing file \"ttylocfile.h\"
  2415. else
  2416. echo shar: Extracting \"ttylocfile.h\" \(1182 characters\)
  2417. sed "s/^X//" >ttylocfile.h <<'END_OF_ttylocfile.h'
  2418. X/*
  2419. X * ttylocfile.h -- defns to read /etc/ttyloc (December 1985)
  2420. X /*
  2421. X * Copyright (C) 1986, 1990  Philip L. Budne
  2422. X *
  2423. X * This file is part of "Phil's Finger Program".
  2424. X *
  2425. X * This program is free software; you can redistribute it and/or modify
  2426. X * it under the terms of the GNU General Public License as published by
  2427. X * the Free Software Foundation; either version 1, or (at your option)
  2428. X * any later version.
  2429. X *
  2430. X */
  2431. X
  2432. X# define TTYLOCFILE_RCSID "$Id: ttylocfile.h,v 3.0 90/07/06 13:12:05 budd Rel $"
  2433. X
  2434. X# ifndef LOCFILE
  2435. X# define LOCFILE "/etc/ttyloc"
  2436. X# endif /* LOCFILE not defined */
  2437. X
  2438. X# ifndef NLOCFILE
  2439. X# define NLOCFILE "/etc/nttyloc"    /* new format file */
  2440. X# endif /* NLOCFILE not defined */
  2441. X
  2442. X# ifndef MAXTTY
  2443. X# define MAXTTY 100            /* number of ttys on system */
  2444. X# endif /* MAXTTY not defined */
  2445. X
  2446. Xtypedef enum { LT_HARD, LT_TTYLOC, LT_DIALUP, LT_UNKNOWN } LINETYPE;
  2447. X
  2448. Xtypedef struct ttyloc {
  2449. X    char *t_name;            /* terminal name */
  2450. X    char *t_locn;            /* default (long) terminal location */
  2451. X    char *t_short;            /* short locn (prepended to user str) */
  2452. X    LINETYPE t_type;            /* line type */
  2453. X} TTYLOC;
  2454. X
  2455. Xextern TTYLOC *findttyloc();
  2456. X
  2457. X/*
  2458. X * Local variables:
  2459. X * comment-column: 40
  2460. X * End:
  2461. X */
  2462. END_OF_ttylocfile.h
  2463. if test 1182 -ne `wc -c <ttylocfile.h`; then
  2464.     echo shar: \"ttylocfile.h\" unpacked with wrong size!
  2465. fi
  2466. # end of overwriting check
  2467. fi
  2468. if test -f upper.c -a "${1}" != "-c" ; then 
  2469.   echo shar: Will not over-write existing file \"upper.c\"
  2470. else
  2471. echo shar: Extracting \"upper.c\" \(819 characters\)
  2472. sed "s/^X//" >upper.c <<'END_OF_upper.c'
  2473. X/*
  2474. X * upper.c -- uppercaseification table
  2475. X *
  2476. X * Copyright (C) 1988, 1990  Philip L. Budne
  2477. X *
  2478. X * This file is part of "Phil's Finger Program".
  2479. X *
  2480. X * This program is free software; you can redistribute it and/or modify
  2481. X * it under the terms of the GNU General Public License as published by
  2482. X * the Free Software Foundation; either version 1, or (at your option)
  2483. X * any later version.
  2484. X *
  2485. X */
  2486. X
  2487. X# ifndef lint
  2488. Xstatic char *rcsid = "$Id: upper.c,v 3.0 90/07/06 13:12:08 budd Rel $";
  2489. X# endif /* lint not defined */
  2490. X
  2491. X# include "finger.h"
  2492. X# include "upper.h"
  2493. X
  2494. XGLOBAL char uppercase[] = "\
  2495. X\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\
  2496. X\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\
  2497. X !\"#$%&'()*+,-./0123456789:;<=>?\
  2498. X@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\
  2499. X`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177";
  2500. END_OF_upper.c
  2501. if test 819 -ne `wc -c <upper.c`; then
  2502.     echo shar: \"upper.c\" unpacked with wrong size!
  2503. fi
  2504. # end of overwriting check
  2505. fi
  2506. if test -f upper.h -a "${1}" != "-c" ; then 
  2507.   echo shar: Will not over-write existing file \"upper.h\"
  2508. else
  2509. echo shar: Extracting \"upper.h\" \(519 characters\)
  2510. sed "s/^X//" >upper.h <<'END_OF_upper.h'
  2511. X/*
  2512. X * upper.h -- extern for uppercaseification table
  2513. X *
  2514. X * Copyright (C) 1986, 1990  Philip L. Budne
  2515. X *
  2516. X * This file is part of "Phil's Finger Program".
  2517. X *
  2518. X * This program is free software; you can redistribute it and/or modify
  2519. X * it under the terms of the GNU General Public License as published by
  2520. X * the Free Software Foundation; either version 1, or (at your option)
  2521. X * any later version.
  2522. X *
  2523. X */
  2524. X
  2525. X# define UPPER_RCSID "$Id: upper.h,v 3.0 90/07/06 13:12:09 budd Rel $"
  2526. X
  2527. X# include "finger.h"
  2528. Xextern char uppercase[];
  2529. END_OF_upper.h
  2530. if test 519 -ne `wc -c <upper.h`; then
  2531.     echo shar: \"upper.h\" unpacked with wrong size!
  2532. fi
  2533. # end of overwriting check
  2534. fi
  2535. if test -f waitstate.h -a "${1}" != "-c" ; then 
  2536.   echo shar: Will not over-write existing file \"waitstate.h\"
  2537. else
  2538. echo shar: Extracting \"waitstate.h\" \(1128 characters\)
  2539. sed "s/^X//" >waitstate.h <<'END_OF_waitstate.h'
  2540. X/*
  2541. X * waitstate.h -- wait state enumeration (once was ttystate.h)
  2542. X *
  2543. X * Copyright (C) 1987, 1990  Philip L. Budne
  2544. X *
  2545. X * This file is part of "Phil's Finger Program".
  2546. X *
  2547. X * This program is free software; you can redistribute it and/or modify
  2548. X * it under the terms of the GNU General Public License as published by
  2549. X * the Free Software Foundation; either version 1, or (at your option)
  2550. X * any later version.
  2551. X *
  2552. X */
  2553. X
  2554. X# define FOO_RCSID "$Id: waitstate.h,v 3.0 90/07/06 13:12:16 budd Rel $"
  2555. X
  2556. X# define _STATES \
  2557. X    _STATE(00)             /* NULL */    \
  2558. X    _STATE(TI)             /* tty input */ \
  2559. X    _STATE(TO)             /* tty output */ \
  2560. X    _STATE(TW)             /* tty wait */    \
  2561. X    _STATE(SE)             /* select(2) */    \
  2562. X    _STATE(RU)             /* runable */    \
  2563. X    _STATE(PA)             /* pause(2) */    \
  2564. X    _STATE(WA)            /* wait(2) */    \
  2565. X    _STATE(SL)            /* other */
  2566. X
  2567. Xtypedef enum { 
  2568. X# define _STATE(s) CONC(WS_,s),
  2569. X    _STATES
  2570. X    WS_XX                /* use up extra comma */
  2571. X# undef _STATE
  2572. X} waitstate_t;
  2573. X
  2574. X# ifdef WAITSTATENAME
  2575. Xchar *WAITSTATENAME[] = {
  2576. X# define _STATE(s) STR(s),
  2577. X    _STATES
  2578. X    "XX"
  2579. X    };
  2580. X# undef _STATE
  2581. X# endif /* WAITSTATENAME defined */
  2582. X
  2583. X/*
  2584. X * Local variables:
  2585. X * comment-column: 40
  2586. X * End:
  2587. X */
  2588. END_OF_waitstate.h
  2589. if test 1128 -ne `wc -c <waitstate.h`; then
  2590.     echo shar: \"waitstate.h\" unpacked with wrong size!
  2591. fi
  2592. # end of overwriting check
  2593. fi
  2594. echo shar: End of archive 1 \(of 7\).
  2595. cp /dev/null ark1isdone
  2596. MISSING=""
  2597. for I in 1 2 3 4 5 6 7 ; do
  2598.     if test ! -f ark${I}isdone ; then
  2599.     MISSING="${MISSING} ${I}"
  2600.     fi
  2601. done
  2602. if test "${MISSING}" = "" ; then
  2603.     echo You have unpacked all 7 archives.
  2604.     rm -f ark[1-9]isdone
  2605. else
  2606.     echo You still need to unpack the following archives:
  2607.     echo "        " ${MISSING}
  2608. fi
  2609. ##  End of shell archive.
  2610. exit 0
  2611.  
  2612.